rhymix/classes/db/queryparts/Subquery.class.php
ngleader dbc18a4f99 change author
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13180 201d5d3c-b55e-5fd7-737f-ddc643e51545
2013-11-07 02:42:42 +00:00

79 lines
1.4 KiB
PHP

<?php
/**
* @author NAVER (developers@xpressengine.com)
* @package /classes/db/queryparts
* @version 0.1
*/
class Subquery extends Query
{
/**
* table alias
* @var string
*/
var $alias;
/**
* join type
* @var string
*/
var $join_type;
/**
* constructor
* @param string $alias
* @param string|array $columns
* @param string|array $tables
* @param string|array $conditions
* @param string|array $groups
* @param string|array $orderby
* @param int $limit
* @param string $join_type
* @return void
*/
function Subquery($alias, $columns, $tables, $conditions, $groups, $orderby, $limit, $join_type = null)
{
$this->alias = $alias;
$this->queryID = null;
$this->action = "select";
$this->columns = $columns;
$this->tables = $tables;
$this->conditions = $conditions;
$this->groups = $groups;
$this->orderby = $orderby;
$this->limit = $limit;
$this->join_type = $join_type;
}
function getAlias()
{
return $this->alias;
}
function isJoinTable()
{
if($this->join_type)
{
return true;
}
return false;
}
function toString($with_values = true)
{
$oDB = &DB::getInstance();
return '(' . $oDB->getSelectSql($this, $with_values) . ')';
}
function isSubquery()
{
return true;
}
}
/* End of file Subquery.class.php */
/* Location: ./classes/db/queryparts/Subquery.class.php */