本文整理汇总了PHP中eZOrder::definition方法的典型用法代码示例。如果您正苦于以下问题:PHP eZOrder::definition方法的具体用法?PHP eZOrder::definition怎么用?PHP eZOrder::definition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZOrder
的用法示例。
在下文中一共展示了eZOrder::definition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: active
static function active($asObject = true, $offset, $limit, $sortField = "created", $sortOrder = "asc", $show = eZOrder::SHOW_NORMAL)
{
if ($sortField == "user_name") {
$db = eZDB::instance();
$db_params = array();
$db_params["offset"] = (int) $offset;
$db_params["limit"] = (int) $limit;
$sortOrder = $db->escapeString($sortOrder);
$query = "SELECT ezorder.*\n FROM\n ezorder,\n ezcontentobject\n WHERE\n " . eZOrder::getShowOrdersQuery($show, "ezorder") . " AND\n ezorder.is_temporary = '0' AND\n ezcontentobject.id = ezorder.user_id\n ORDER BY ezcontentobject.name {$sortOrder}";
$orderArray = $db->arrayQuery($query, $db_params);
if ($asObject) {
$retOrders = array();
foreach ($orderArray as $order) {
$order = new eZOrder($order);
$retOrders[] = $order;
}
return $retOrders;
} else {
return $orderArray;
}
} else {
$where['is_temporary'] = 0;
if ($show != eZOrder::SHOW_ALL) {
$where['is_archived'] = $show;
}
return eZPersistentObject::fetchObjectList(eZOrder::definition(), null, $where, array($sortField => $sortOrder), array('offset' => $offset, 'length' => $limit), $asObject);
}
}