当前位置: 首页>>代码示例>>PHP>>正文


PHP MY_Model::count_by方法代码示例

本文整理汇总了PHP中MY_Model::count_by方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Model::count_by方法的具体用法?PHP MY_Model::count_by怎么用?PHP MY_Model::count_by使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MY_Model的用法示例。


在下文中一共展示了MY_Model::count_by方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 function is_subscribed($user_id, $topic_id)
 {
     if (parent::count_by(array('user_id' => $user_id, 'topic_id' => $topic_id)) > 0) {
         return TRUE;
     }
     return FALSE;
 }
开发者ID:Tapha,项目名称:pyrocms,代码行数:7,代码来源:forum_subscriptions_m.php

示例2: check_name

	/**
	 * Check name
	 *
     * @access	public
	 * @param	string	$name
	 * @param	id		$id
	 * @return	bool
	 */
    public function check_name($name = '', $id = 0)
    {
    	return (int) parent::count_by(array(
			'id !='	=>	$id,
			'name'	=>	$name
		)) > 0;
    }
开发者ID:reith2004,项目名称:pyrocms,代码行数:15,代码来源:variables_m.php

示例3: is_default

    /**
     * Is Default
     */
    public function is_default($id = 0)
    {
		return parent::count_by(array(
			'id'			=> $id,
			'is_default >'	=> 0,
		)) > 0;
    }
开发者ID:reith2004,项目名称:pyrocms,代码行数:10,代码来源:email_templates_m.php

示例4:

 function check_slug($slug, $id = NULL)
 {
     if ($id) {
         $this->db->where('id !=', $id);
     }
     return parent::count_by('slug', $slug) == 0;
 }
开发者ID:Tapha,项目名称:pyrocms,代码行数:7,代码来源:photo_albums_m.php

示例5: exists

 /**
  * Exists
  *
  * Checks if a given file exists.
  * 
  * @param	int		The file id
  * @return	bool	If the file exists
  */
 public function exists($file_id)
 {
     return (bool) (parent::count_by(array('id' => $file_id)) > 0);
 }
开发者ID:nockout,项目名称:tshpro,代码行数:12,代码来源:file_m.php

示例6: _unique_slug

 /**
  * Check Slug for Uniqueness
  *
  * Slugs should be unique among sibling pages.
  *
  * @param string $slug The slug to check for.
  * @param int $parent_id The parent_id if any.
  * @param int $id The id of the page.
  *
  * @return bool
  */
 public function _unique_slug($slug, $parent_id, $id = 0)
 {
     return (bool) parent::count_by(array('id !=' => $id, 'slug' => $slug, 'parent_id' => $parent_id)) > 0;
 }
开发者ID:nockout,项目名称:tshpro,代码行数:15,代码来源:page_m.php

示例7: check_title

	/**
	 * Callback method for validating the title
	 * @access public
	 * @param string $title The title to validate
	 * @return mixed
	 */
	public function check_title($title = '')
	{
		return parent::count_by('slug', url_title($title)) > 0;
	}
开发者ID:reith2004,项目名称:pyrocms,代码行数:10,代码来源:blog_categories_m.php

示例8: has_children

 /**
  * Has Children
  *
  * Checks if a given folder has children or not.
  *
  * @access	public
  * @param	int		The folder id
  * @return	bool	If the folder has children
  */
 public function has_children($folder_id = 0)
 {
     return (bool) (parent::count_by(array('parent_id' => $folder_id)) > 0);
 }
开发者ID:nockout,项目名称:tshpro,代码行数:13,代码来源:file_folders_m.php

示例9: check_slug

 /**
  * Check Slug for Uniqueness
  * @access public
  * @param slug, parent id, this records id
  * @return bool
  */
 public function check_slug($slug, $parent_id, $id = 0)
 {
     return (int) parent::count_by(array('id !=' => $id, 'slug' => $slug, 'parent_id' => $parent_id)) > 0;
 }
开发者ID:phonglanpls,项目名称:jz-proj-2012,代码行数:10,代码来源:page_m.php

示例10: count_prior_posts

 /**
  * Count Prior Posts
  *
  * How many posts were before this one.  Used for pagination.
  *
  * @access       public
  * @param        int 	[$topic_id] 	Which topic
  * @param        int 	[$reply_time] 	Reply time o compair
  * @return       int
  * @package      forums
  */
 public function count_prior_posts($topic_id, $reply_time)
 {
     return parent::count_by(array('parent_id' => $topic_id, 'created_on <' => $reply_time)) + 1;
 }
开发者ID:Tapha,项目名称:pyrocms,代码行数:15,代码来源:forum_posts_m.php

示例11:

 function check_name($id, $name = '')
 {
     return parent::count_by(array('id !=' => $id, 'name' => $name)) != 0;
 }
开发者ID:netfreak,项目名称:pyrocms,代码行数:4,代码来源:variables_m.php

示例12: _check_pt_slug

 /**
  * Validation callback to check the
  * page type slug. We want page type slugs
  * to be unique so we can use them as folder
  * names when saving as files.
  *
  * @access  public
  * @param   string $slug - the page slug
  * @return  bool
  */
 public function _check_pt_slug($slug)
 {
     if (parent::count_by(array('slug' => $slug)) == 0) {
         return true;
     } else {
         $this->form_validation->set_message('_check_pt_slug', lang('page_types:_check_pt_slug_msg'));
         return false;
     }
 }
开发者ID:blekedeg,项目名称:lbhpers,代码行数:19,代码来源:page_type_m.php

示例13:

 function check_slug($slug = '')
 {
     return parent::count_by('slug', $slug) == 0;
 }
开发者ID:netfreak,项目名称:pyrocms,代码行数:4,代码来源:news_m.php

示例14: check_slug

	/**
	 * Callback method for validating the slug
	 * @access public
	 * @param string $slug The slug to validate
	 * @param int $id The id of gallery
	 * @return bool
	 */
	public function check_slug($slug = '', $id = 0)
	{
		return parent::count_by(array(
			'id !='	=> $id,
			'slug'	=> $slug)
		) > 0;
	}
开发者ID:JamieLomas,项目名称:pyrocms,代码行数:14,代码来源:galleries_m.php

示例15: has_children

	/**
	 * Does the page have children?
	 *
	 * @access public
	 * @param int $parent_id The ID of the parent page
	 * @return mixed
	 */
	public function has_children($parent_id)
	{
		return parent::count_by(array('parent_id' => $parent_id)) > 0;
	}
开发者ID:JamieLomas,项目名称:pyrocms,代码行数:11,代码来源:pages_m.php


注:本文中的MY_Model::count_by方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。