本文整理汇总了PHP中RedBean_OODBBean::with方法的典型用法代码示例。如果您正苦于以下问题:PHP RedBean_OODBBean::with方法的具体用法?PHP RedBean_OODBBean::with怎么用?PHP RedBean_OODBBean::with使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RedBean_OODBBean
的用法示例。
在下文中一共展示了RedBean_OODBBean::with方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: openList
/**
* Opens a list and returns the contents of the list.
* By default a list is interpreted as the own-list of the current bean.
* If the list begins with the prefix 'shared-' the shared list of the
* bean will be opened instead. Internal method.
*
* @return array
*/
private function openList()
{
$listOfBeans = array();
$listName = strpos($this->list, 'shared-') === 0 ? 'shared' . ucfirst(substr($this->list, 7)) : 'own' . ucfirst($this->list);
if ($this->sqlSnippet) {
if (preg_match('/^(ORDER|GROUP|HAVING|LIMIT|OFFSET|TOP)\\s+/i', ltrim($this->sqlSnippet))) {
$beans = $this->bean->with($this->sqlSnippet, $this->sqlBindings)->{$listName};
} else {
$beans = $this->bean->withCondition($this->sqlSnippet, $this->sqlBindings)->{$listName};
}
} else {
$beans = $this->bean->{$listName};
}
foreach ($beans as $listBean) {
$listOfBeans[] = $listBean->export();
}
return $this->resp($listOfBeans);
}