本文整理汇总了PHP中xPDOQuery::getAlias方法的典型用法代码示例。如果您正苦于以下问题:PHP xPDOQuery::getAlias方法的具体用法?PHP xPDOQuery::getAlias怎么用?PHP xPDOQuery::getAlias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xPDOQuery
的用法示例。
在下文中一共展示了xPDOQuery::getAlias方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Construct a new xPDOIterator instance (do not call directly).
*
* @see xPDO::getIterator()
* @param xPDO &$xpdo A reference to a valid xPDO instance.
* @param array $options An array of options for the iterator.
* @return xPDOIterator An xPDOIterator instance.
*/
function __construct(&$xpdo, array $options = array())
{
$this->xpdo =& $xpdo;
if (isset($options['class'])) {
$this->class = $this->xpdo->loadClass($options['class']);
}
if (isset($options['alias'])) {
$this->alias = $options['alias'];
} else {
$this->alias = $this->class;
}
if (isset($options['cacheFlag'])) {
$this->cacheFlag = $options['cacheFlag'];
}
if (array_key_exists('criteria', $options) && is_object($options['criteria'])) {
$this->criteria = $options['criteria'];
} elseif (!empty($this->class)) {
$criteria = array_key_exists('criteria', $options) ? $options['criteria'] : null;
$this->criteria = $this->xpdo->getCriteria($this->class, $criteria, $this->cacheFlag);
}
if (!empty($this->criteria)) {
$this->criteriaType = $this->xpdo->getCriteriaType($this->criteria);
if ($this->criteriaType === 'xPDOQuery') {
$this->class = $this->criteria->getClass();
$this->alias = $this->criteria->getAlias();
}
}
}
示例2: setSelection
protected function setSelection(xPDOQuery $c)
{
$alias = $c->getAlias();
$c->select(array("{$alias}.*", "{$alias}.id as `object_id`"));
return $c;
}