本文整理汇总了PHP中Entry::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Entry::count方法的具体用法?PHP Entry::count怎么用?PHP Entry::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry::count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: entry_count
public function entry_count()
{
$child_class = $this->class === 'category' ? 'entry' : 'page';
$blog_id = $this->blog_id;
$cat_id = $this->id;
$where = "entry_status = 2\n and entry_class = '{$child_class}'\n and entry_blog_id = {$blog_id}";
$join = array();
$join['mt_placement'] = array('condition' => "placement_entry_id = entry_id and placement_category_id = {$cat_id}");
require_once 'class.mt_entry.php';
$entry = new Entry();
$cnt = $entry->count(array('where' => $where, 'join' => $join));
return $cnt;
}
示例2: author_entry_count
public function author_entry_count($args)
{
if ($sql = $this->include_exclude_blogs($args)) {
$blog_filter = 'and entry_blog_id ' . $sql;
} elseif (isset($args['blog_id'])) {
$blog_id = intval($args['blog_id']);
$blog_filter = 'and entry_blog_id = ' . $blog_id;
}
if (isset($args['author_id'])) {
$author_id = intval($args['author_id']);
$author_filter = " and entry_author_id = {$author_id}";
}
$class = 'entry';
if (isset($args['class'])) {
$class = $args['class'];
}
$where = "entry_status = 2\n and entry_class='{$class}'\n {$blog_filter}\n {$author_filter}";
require_once 'class.mt_entry.php';
$entry = new Entry();
$count = $entry->count(array('where' => $where));
return $count;
}