Skip to content

Commit

Permalink
#2181 Object 클래스 BaseObject로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
bnu committed Nov 27, 2017
1 parent 108408c commit 82f9916
Show file tree
Hide file tree
Showing 141 changed files with 1,168 additions and 1,163 deletions.
2 changes: 1 addition & 1 deletion classes/context/Context.class.php
Expand Up @@ -1996,7 +1996,7 @@ function getAll()
/**
* Return values from the GET/POST/XMLRPC
*
* @return Object Request variables.
* @return BaseObject Request variables.
*/
function getRequestVars()
{
Expand Down
30 changes: 15 additions & 15 deletions classes/db/DB.class.php
Expand Up @@ -147,7 +147,7 @@ function getInstance($db_type = NULL)
}
if(!$db_type && Context::isInstalled())
{
return new Object(-1, 'msg_db_not_setted');
return new BaseObject(-1, 'msg_db_not_setted');
}

if(!isset($GLOBALS['__DB__']))
Expand All @@ -160,7 +160,7 @@ function getInstance($db_type = NULL)
$class_file = _XE_PATH_ . "classes/db/$class_name.class.php";
if(!file_exists($class_file))
{
return new Object(-1, 'msg_db_not_setted');
return new BaseObject(-1, 'msg_db_not_setted');
}

// get a singletone instance of the database driver class
Expand Down Expand Up @@ -495,7 +495,7 @@ function isError()
function getError()
{
$this->errstr = Context::convertEncodingStr($this->errstr);
return new Object($this->errno, $this->errstr);
return new BaseObject($this->errno, $this->errstr);
}

/**
Expand All @@ -512,7 +512,7 @@ function executeQuery($query_id, $args = NULL, $arg_columns = NULL, $type = NULL

if(!$query_id)
{
return new Object(-1, 'msg_invalid_queryid');
return new BaseObject(-1, 'msg_invalid_queryid');
}
if(!$this->db_type)
{
Expand Down Expand Up @@ -547,14 +547,14 @@ function executeQuery($query_id, $args = NULL, $arg_columns = NULL, $type = NULL
if(!$target || !$module || !$id)
{
$this->actDBClassFinish();
return new Object(-1, 'msg_invalid_queryid');
return new BaseObject(-1, 'msg_invalid_queryid');
}

$xml_file = sprintf('%s%s/%s/queries/%s.xml', _XE_PATH_, $target, $module, $id);
if(!file_exists($xml_file))
{
$this->actDBClassFinish();
return new Object(-1, 'msg_invalid_queryid');
return new BaseObject(-1, 'msg_invalid_queryid');
}

// look for cache file
Expand Down Expand Up @@ -610,7 +610,7 @@ function _executeQuery($cache_file, $source_args, $query_id, $arg_columns, $type

if(!file_exists($cache_file))
{
return new Object(-1, 'msg_invalid_queryid');
return new BaseObject(-1, 'msg_invalid_queryid');
}

if($source_args)
Expand All @@ -620,7 +620,7 @@ function _executeQuery($cache_file, $source_args, $query_id, $arg_columns, $type

$output = include($cache_file);

if((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool())
if((is_a($output, 'BaseObject') || is_subclass_of($output, 'BaseObject')) && !$output->toBool())
{
return $output;
}
Expand Down Expand Up @@ -653,9 +653,9 @@ function _executeQuery($cache_file, $source_args, $query_id, $arg_columns, $type
{
$output = $this->getError();
}
else if(!is_a($output, 'Object') && !is_subclass_of($output, 'Object'))
else if(!is_a($output, 'BaseObject') && !is_subclass_of($output, 'BaseObject'))
{
$output = new Object();
$output = new BaseObject();
}
$output->add('_query', $this->query);
$output->add('_elapsed_time', sprintf("%0.5f", $this->elapsed_time));
Expand Down Expand Up @@ -818,14 +818,14 @@ function getSelectSql($query, $with_values = TRUE)
$select = $query->getSelectString($with_values);
if($select == '')
{
return new Object(-1, "Invalid query");
return new BaseObject(-1, "Invalid query");
}
$select = 'SELECT ' . $select;

$from = $query->getFromString($with_values);
if($from == '')
{
return new Object(-1, "Invalid query");
return new BaseObject(-1, "Invalid query");
}
$from = ' FROM ' . $from;

Expand Down Expand Up @@ -920,7 +920,7 @@ function getDeleteSql($query, $with_values = TRUE, $with_priority = FALSE)
$from = $query->getFromString($with_values);
if($from == '')
{
return new Object(-1, "Invalid query");
return new BaseObject(-1, "Invalid query");
}
$sql .= ' FROM ' . $from;

Expand All @@ -945,13 +945,13 @@ function getUpdateSql($query, $with_values = TRUE, $with_priority = FALSE)
$columnsList = $query->getUpdateString($with_values);
if($columnsList == '')
{
return new Object(-1, "Invalid query");
return new BaseObject(-1, "Invalid query");
}

$tables = $query->getFromString($with_values);
if($tables == '')
{
return new Object(-1, "Invalid query");
return new BaseObject(-1, "Invalid query");
}

$where = $query->getWhereString($with_values);
Expand Down
38 changes: 19 additions & 19 deletions classes/db/DBCubrid.class.php
Expand Up @@ -850,7 +850,7 @@ function _createTable($xml_doc)

/**
* Handles insertAct
* @param Object $queryObject
* @param BaseObject $queryObject
* @param boolean $with_values
* @return resource
*/
Expand All @@ -862,7 +862,7 @@ function _executeInsertAct($queryObject, $with_values = TRUE)
$with_values = FALSE;
}
$query = $this->getInsertSql($queryObject, $with_values);
if(is_a($query, 'Object'))
if(is_a($query, 'BaseObject'))
{
unset($this->param);
return;
Expand All @@ -881,7 +881,7 @@ function _executeInsertAct($queryObject, $with_values = TRUE)

/**
* Handles updateAct
* @param Object $queryObject
* @param BaseObject $queryObject
* @param boolean $with_values
* @return resource
*/
Expand All @@ -893,7 +893,7 @@ function _executeUpdateAct($queryObject, $with_values = TRUE)
$with_values = FALSE;
}
$query = $this->getUpdateSql($queryObject, $with_values);
if(is_a($query, 'Object'))
if(is_a($query, 'BaseObject'))
{
unset($this->param);
return;
Expand All @@ -913,7 +913,7 @@ function _executeUpdateAct($queryObject, $with_values = TRUE)

/**
* Handles deleteAct
* @param Object $queryObject
* @param BaseObject $queryObject
* @param boolean $with_values
* @return resource
*/
Expand All @@ -925,7 +925,7 @@ function _executeDeleteAct($queryObject, $with_values = TRUE)
$with_values = FALSE;
}
$query = $this->getDeleteSql($queryObject, $with_values);
if(is_a($query, 'Object'))
if(is_a($query, 'BaseObject'))
{
unset($this->param);
return;
Expand All @@ -948,10 +948,10 @@ function _executeDeleteAct($queryObject, $with_values = TRUE)
* Handle selectAct
* To get a specific page list easily in select statement,
* a method, navigation, is used
* @param Object $queryObject
* @param BaseObject $queryObject
* @param resource $connection
* @param boolean $with_values
* @return Object
* @return BaseObject
*/
function _executeSelectAct($queryObject, $connection = NULL, $with_values = TRUE)
{
Expand All @@ -968,7 +968,7 @@ function _executeSelectAct($queryObject, $connection = NULL, $with_values = TRUE
else
{
$query = $this->getSelectSql($queryObject, $with_values);
if(is_a($query, 'Object'))
if(is_a($query, 'BaseObject'))
{
unset($this->param);
return;
Expand All @@ -984,7 +984,7 @@ function _executeSelectAct($queryObject, $connection = NULL, $with_values = TRUE
}

$data = $this->_fetch($result);
$buff = new Object ();
$buff = new BaseObject();
$buff->data = $data;

unset($this->param);
Expand All @@ -994,15 +994,15 @@ function _executeSelectAct($queryObject, $connection = NULL, $with_values = TRUE

/**
* If have a error, return error object
* @param Object $queryObject
* @return Object
* @param BaseObject $queryObject
* @return BaseObject
*/
function queryError($queryObject)
{
$limit = $queryObject->getLimit();
if($limit && $limit->isPageHandler())
{
$buff = new Object ();
$buff = new BaseObject ();
$buff->total_count = 0;
$buff->total_page = 0;
$buff->page = 1;
Expand All @@ -1015,10 +1015,10 @@ function queryError($queryObject)

/**
* If select query execute, return page info
* @param Object $queryObject
* @param BaseObject $queryObject
* @param resource $connection
* @param boolean $with_values
* @return Object Object with page info containing
* @return BaseObject BaseObject with page info containing
*/
function queryPageLimit($queryObject, $connection, $with_values)
{
Expand Down Expand Up @@ -1080,7 +1080,7 @@ function queryPageLimit($queryObject, $connection, $with_values)
{
// If requested page is bigger than total number of pages, return empty list

$buff = new Object ();
$buff = new BaseObject();
$buff->total_count = $total_count;
$buff->total_page = $total_page;
$buff->page = $page;
Expand All @@ -1103,7 +1103,7 @@ function queryPageLimit($queryObject, $connection, $with_values)
$virtual_no = $total_count - ($page - 1) * $list_count;
$data = $this->_fetch($result, $virtual_no);

$buff = new Object ();
$buff = new BaseObject();
$buff->total_count = $total_count;
$buff->total_page = $total_page;
$buff->page = $page;
Expand Down Expand Up @@ -1137,14 +1137,14 @@ function getSelectPageSql($query, $with_values = TRUE, $start_count = 0, $list_c
$select = $query->getSelectString($with_values);
if($select == '')
{
return new Object(-1, "Invalid query");
return new BaseObject(-1, "Invalid query");
}
$select = 'SELECT ' . $select;

$from = $query->getFromString($with_values);
if($from == '')
{
return new Object(-1, "Invalid query");
return new BaseObject(-1, "Invalid query");
}
$from = ' FROM ' . $from;

Expand Down

0 comments on commit 82f9916

Please sign in to comment.