本文整理汇总了PHP中QueryBuilder::params方法的典型用法代码示例。如果您正苦于以下问题:PHP QueryBuilder::params方法的具体用法?PHP QueryBuilder::params怎么用?PHP QueryBuilder::params使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryBuilder
的用法示例。
在下文中一共展示了QueryBuilder::params方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEntities
protected function getEntities($key)
{
if (!isset($this->relationships[$key])) {
return false;
}
$relationship = $this->relationships[$key];
if (!isset($this->managers[$relationship['manager']])) {
$this->managers[$relationship['manager']] = $this->factory->get($key);
}
$manager = $this->managers[$relationship['manager']];
/* @var $manager ManagerAbstract */
$query = new QueryBuilder($manager->table(), $this->factory::connection(), $relationship['conditions']);
$original_params = $query->params();
$params = array();
foreach ($original_params as $param) {
if (stripos($param, 'entity.' === 0)) {
$param = $this->entity[substr($param, 7)];
}
$params[] = $param;
}
if ($relationship['relation'] == 'HasOne') {
$this->entities[$key] = $manager->fetch($query, $params);
} else {
$this->entities[$key] = $manager->fetchAll($query, $params);
}
return $this->entities[$key];
}