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


PHP MY_Model::get_all方法代码示例

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


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

示例1: get_all

 public function get_all()
 {
     $this->db->select('stories.id, type, headline, state, story, views, image, media, anonymous, user_id, upvote, downvote, date_created, date_modified, status, users.username, users.first_name, users.last_name');
     $this->db->join('users', 'stories.user_id = users.id', 'full');
     $this->db->order_by('stories.date_created desc');
     return parent::get_all();
 }
开发者ID:andela-cnnadi,项目名称:paruto,代码行数:7,代码来源:story_model.php

示例2: get_all

	/**
	 * Get all galleries along with the total number of photos in each gallery
	 *
	 * @author Yorick Peterse - PyroCMS Dev Team
	 * @access public
	 * @return mixed
	 */
	public function get_all()
	{
		$this->db
			->select('galleries.*, file_folders.slug as folder_slug, file_folders.name as folder_name')
			->join('file_folders', 'file_folders.id = galleries.folder_id', 'left');

		$galleries	= parent::get_all();
		$results	= array();

		// Loop through each gallery and add the count of photos to the results
		foreach ($galleries as $gallery)
		{
			$count = $this->db
				->select('files.id')
				->join('galleries', 'galleries.folder_id = files.folder_id', 'left')
				->where('files.type', 'i')
				->where('galleries.id', $gallery->id)
				->count_all_results('files');

			$gallery->photo_count = $count;
			$results[] = $gallery;
		}

		// Return the results
		return $results;
	}
开发者ID:JamieLomas,项目名称:pyrocms,代码行数:33,代码来源:galleries_m.php

示例3: get_all

 /**
  * Return an array of groups
  *
  * 
  * @param array $params Optional parameters
  * @return array
  */
 public function get_all($params = array())
 {
     if (isset($params['except'])) {
         $this->db->where_not_in('name', $params['except']);
     }
     return parent::get_all();
 }
开发者ID:nockout,项目名称:tshpro,代码行数:14,代码来源:group_m.php

示例4: get_one

 public function get_one()
 {
     $new = array();
     $this->db->limit(1);
     $this->db->order_by('create_date', 'desc');
     $new = parent::get_all();
     return $new[0];
 }
开发者ID:fathan,项目名称:CI-Hotel,代码行数:8,代码来源:m_news.php

示例5: get_all

 public function get_all()
 {
     $this->db->select('comments.*');
     $this->db->select('IF(comments.user_id > 0, IF(u.last_name = "", u.first_name, CONCAT(u.first_name, " ", u.last_name)), comments.name) as name');
     $this->db->select('IF(comments.user_id > 0, u.email, comments.email) as email');
     $this->db->join('users u', 'comments.user_id = u.id', 'left');
     return parent::get_all();
 }
开发者ID:baltag,项目名称:pyrocms,代码行数:8,代码来源:comments_m.php

示例6: get_all

 public function get_all()
 {
     $result = parent::get_all();
     if ($result) {
         array_map(array($this, 'unserialize_fields'), $result);
     }
     return $result;
 }
开发者ID:namdum,项目名称:pyrocms,代码行数:8,代码来源:widget_m.php

示例7: list_db_modules

 /**
  * Returns an array with currently all modules registered in database
  * @return array Array with module names
  */
 public function list_db_modules()
 {
     $modulesDb = parent::get_all();
     $dbModules = array();
     foreach ($modulesDb as $mod) {
         $dbModules[] = $mod->link;
     }
     return $dbModules;
 }
开发者ID:karlomikus,项目名称:CometCI,代码行数:13,代码来源:modules_m.php

示例8: IF

	function get_all()
    {
    	$this->db->select('profiles.*, users.*, g.description as group_name, IF(profiles.last_name = "", profiles.first_name, CONCAT(profiles.first_name, " ", profiles.last_name)) as full_name')
    			 ->join('groups g', 'g.id = users.group_id')
    			 ->join('profiles', 'profiles.user_id = users.id', 'left');
    		
        $this->db->group_by('users.id');
    	return parent::get_all();
    }    
开发者ID:reith2004,项目名称:pyrocms,代码行数:9,代码来源:users_m.php

示例9: get_promokelas

 public function get_promokelas()
 {
     $this->db->select('promote.idpromo, class.title as "nmclass", class.price, promote.discount, promote.start_date, promote.end_date, promote.description as "desc", promote.title as "prom", foto_produk.thumb');
     $this->db->join('class', 'promote.idclass = class.idclass', 'left');
     $this->db->join('foto_produk', 'promote.idclass = foto_produk.idclass', 'left');
     $this->db->where('promote.end_date >=', date('Y-m-d'));
     $this->db->where('promote.status', 1);
     $this->db->group_by('promote.idpromo');
     return parent::get_all();
 }
开发者ID:fathan,项目名称:CI-Hotel,代码行数:10,代码来源:m_promo.php

示例10: CONCAT

    function get_all()
    {
    	$this->db
	    ->select($this->profile_table.'.*, g.description as group_name, users.*')
	    ->select('IF('.$this->profile_table.'.last_name = "", '.$this->profile_table.'.first_name, CONCAT('.$this->profile_table.'.first_name, " ", '.$this->profile_table.'.last_name)) as full_name', FALSE)
	    ->join('groups g', 'g.id = users.group_id')
	    ->join('profiles', 'profiles.user_id = users.id', 'left')
	    ->group_by('users.id');
	    
    	return parent::get_all();
    }
开发者ID:JamieLomas,项目名称:pyrocms,代码行数:11,代码来源:users_m.php

示例11: get_all

 /**
  * Get all members 
  *
  * @author Buonzz
  * @access public
  * @return mixed
  */
 public function get_all()
 {
     $members = parent::get_all();
     $results = array();
     // Loop through each member
     foreach ($members as $member) {
         $results[] = $member;
     }
     // Return the results
     return $results;
 }
开发者ID:hassana19,项目名称:pyro-membership,代码行数:18,代码来源:members_m.php

示例12: get_matches

 /**
  * Gets all matches
  * @param  boolean $all If false gets all matches that are not upcoming
  * @return object       Object with match results
  */
 public function get_matches($all = TRUE)
 {
     if ($all) {
         parent::order_by('date', 'DESC');
         return parent::get_all();
     } else {
         parent::order_by('date', 'DESC');
         $this->db->select('*');
         $this->db->where('status !=', '1');
         return $this->db->get('matches')->result();
     }
 }
开发者ID:karlomikus,项目名称:CometCI,代码行数:17,代码来源:matches_m.php

示例13: get_active_forum_labels

 public function get_active_forum_labels()
 {
     $this->_table = 'forum_forums';
     $labels = array();
     $forums = parent::get_all();
     foreach ($forums as $forum) {
         if (!in_array($forum->label, $labels)) {
             $labels[] = $forum->label;
         }
     }
     return $labels;
 }
开发者ID:karlomikus,项目名称:CometCI,代码行数:12,代码来源:forums_m.php

示例14: get_settings

 /**
  * Get Pam Module settings.
  * 
  * Takes the work out of grabbing the settings whenever
  * we need them. Will also return a single value if
  * needed.
  * 
  * @param str $field The settings field to retrieve.
  * @return array / str
  */
 public function get_settings($field = null)
 {
     // return value of a single setting
     if ($field) {
         $settings = parent::get_all();
         $settings = $settings[0];
         $result = property_exists($settings, $field) ? $settings->{$field} : 'Invalid field.';
     } else {
         $settings = parent::get_all();
         $result = $settings[0];
     }
     return $result;
 }
开发者ID:arjint2004,项目名称:pam,代码行数:23,代码来源:slider_m.php

示例15: get_all

 /**
  * Get all galleries along with the total number of photos in each gallery
  *
  * @author Yorick Peterse - PyroCMS Dev Team
  * @access public
  * @return mixed
  */
 public function get_all()
 {
     $galleries = parent::get_all();
     $results = array();
     // Loop through each gallery and add the count of photos to the results
     foreach ($galleries as $gallery) {
         $count = $this->db->select('id')->where('gallery_id', $gallery->id)->count_all_results('gallery_images');
         $gallery->photo_count = $count;
         $results[] = $gallery;
     }
     // Return the results
     return $results;
 }
开发者ID:revolveweb,项目名称:pyrocms,代码行数:20,代码来源:galleries_m.php


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