本文整理汇总了PHP中Entry::order方法的典型用法代码示例。如果您正苦于以下问题:PHP Entry::order方法的具体用法?PHP Entry::order怎么用?PHP Entry::order使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry::order方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: blogEntry
public static function blogEntry($author_id = '',$entry_id = '')
{
$entry = new Entry();
$min_access = Application::user()->minAccessLevel();
$access = $entry->also('Access');
$access->clause('access_level',$min_access,Clause::GTE);
if(Application::user()->id())
{
$lbk_user = $entry->also('LogbookUser');
$lbk_user->clauseSafe('user_id',Application::user()->id());
}
if($author_id)
$entry->clauseSafe('author_id',Logbook::current()->authorId());
$entry->maybe('BlogTag');
if(!$entry_id)
$entry_id = Application::param('entry_id');
if($entry_id&&$author_id)
$entry->clauseSafe('entry_id',$entry_id);
$entry->order('entry_date');
/*$entry->order('author_id');
$entry->order('entry_id');*/
$entry->maybe('Comment');
$entry->descending();
try
{
$page = $entry->page(1,1);
$ret = current($page->objects());
Logbook::current()->setAuthorId($ret->get('author_id'));
}
catch(Exception $exc)
{
$ret = new Entry();
}
return $ret;
}
示例2: blogEntries
protected function blogEntries()
{
$entry = new Entry();
$entry->clause('author_id',Application::param('author_id'));
$entry->order($this->order_by);
if($this->descending)
$entry->descending();
$entry->maybe('Comment');
try
{
$ret = $entry->page($this->page_num,$this->num_per_page);
}
catch(Exception $e)
{
$ret = false;
}
return $ret;
}
示例3: getSearchObjectForUser
private static function getSearchObjectForUser($user)
{
$min_access = $user->minAccessLevel();
$ret = new Entry();
$access = $ret->also('Access');
$access->clause('access_level', $min_access, Clause::GTE);
if (Application::user()->id()) {
$lbk_user = $ret->also('LogbookUser');
$lbk_user->clause('user_id', $user);
}
$ret->order('entry_date');
$ret->descending();
$ret->sterile();
return $ret;
}