本文整理汇总了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();
}
示例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;
}
示例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();
}
示例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];
}
示例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();
}
示例6: get_all
public function get_all()
{
$result = parent::get_all();
if ($result) {
array_map(array($this, 'unserialize_fields'), $result);
}
return $result;
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}