本文整理汇总了PHP中XoopsPersistableObjectHandler::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsPersistableObjectHandler::getAll方法的具体用法?PHP XoopsPersistableObjectHandler::getAll怎么用?PHP XoopsPersistableObjectHandler::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsPersistableObjectHandler
的用法示例。
在下文中一共展示了XoopsPersistableObjectHandler::getAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRelated
public function getRelated($start = 0, $limit = 0, $sort = 'related_name', $order = 'ASC')
{
$criteria = new CriteriaCompo();
$criteria->setSort($sort);
$criteria->setOrder($order);
$criteria->setStart($start);
$criteria->setLimit($limit);
return parent::getAll($criteria, null, false);
}
示例2: getCatIds
function getCatIds($uids = null)
{
if ($uids == null) {
return false;
}
$criteria = new CriteriaCompo();
$criteria->add(new Criteria("uid", "(" . implode(", ", $uids) . ")", "in"), 'AND');
$cats = parent::getAll($criteria, null, false);
return $cats;
}
示例3: getAllByFieldId
/**
* get all rows matching a condition
*
* @param CriteriaElement $criteria {@link CriteriaElement} to match
*
* @return array of row arrays, indexed by field_id
*/
public function getAllByFieldId(CriteriaElement $criteria = null)
{
$rawRows = parent::getAll($criteria, null, false, false);
usort($rawRows, array($this, 'visibilitySort'));
$rows = array();
foreach ($rawRows as $rawRow) {
$rows[$rawRow['field_id']][] = $rawRow;
}
return $rows;
}
示例4: getStats
public function getStats($content_id)
{
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('rating_content_id', $content_id));
$i = 0;
$total = 0;
$obj = parent::getAll($criteria);
foreach ($obj as $k => $v) {
++$i;
$total += $v->getVar('rating_rating');
}
return array('voters' => $i, 'average' => $total / $i);
}
示例5: getPageTitle
public function getPageTitle($status = null, $sort = 'content_weight ASC, content_title', $order = 'ASC')
{
$criteria = new CriteriaCompo();
if (isset($status)) {
$criteria->add(new Criteria('content_status', $status));
}
$criteria->setSort($sort);
$criteria->setOrder($order);
return parent::getAll($criteria, array('content_id', 'content_title'), false);
}
示例6: menu_related
public function menu_related($content_id)
{
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('link_content_id', $content_id));
$related = parent::getAll($criteria, null, true, false);
if (count($related) > 0) {
$related_Handler = Page::getInstance()->getRelatedHandler();
$related_arr = $related_Handler->get($related[0]->getVar('link_related_id'));
$ret = $related_arr->getValues();
// create button prev / next
$keys = array_keys($ret['related_links']);
foreach ($keys as $k => $i) {
if ($content_id == $ret['related_links'][$i]['content_id']) {
if ($k - 1 >= 0) {
$ret['prev_id'] = $ret['related_links'][$keys[$k - 1]]['content_id'];
$ret['prev_title'] = $ret['related_links'][$keys[$k - 1]]['content_title'];
}
if ($k + 1 < count($keys)) {
$ret['next_id'] = $ret['related_links'][$keys[$k + 1]]['content_id'];
$ret['next_title'] = $ret['related_links'][$keys[$k + 1]]['content_title'];
}
break;
}
}
return $ret;
}
return array();
}
示例7: getBySpotlight
function getBySpotlight($spotlight_id, $limit = 5, $sort = 'page_order', $order = 'ASC')
{
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('sp_id', $spotlight_id));
$criteria->setLimit($limit);
$criteria->setSort($sort);
$criteria->setOrder($order);
$pages = parent::getAll($criteria, array('page_id', 'page_title', 'page_link', 'page_image', 'page_desc'), false);
return $pages;
}