本文整理汇总了PHP中MY_Model::get_many_by方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Model::get_many_by方法的具体用法?PHP MY_Model::get_many_by怎么用?PHP MY_Model::get_many_by使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MY_Model
的用法示例。
在下文中一共展示了MY_Model::get_many_by方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_view_status
public function update_view_status($userID)
{
$query = parent::get_many_by('to', $userID);
$data = array('status' => 1);
foreach ($query as $msg) {
parent::update($msg->id, $data);
}
}
示例2: getCategoryPortfolioIds
/**
*
* @param int $categoryId
* @return array
*/
public function getCategoryPortfolioIds($categoryId)
{
$catPortfolioIds = parent::get_many_by('category_id', $categoryId);
$portfolioIds = array();
foreach ($catPortfolioIds as $catPortfolioId) {
$portfolioIds[] = $catPortfolioId->portfolio_id;
}
return $portfolioIds;
}
示例3: get_templates
public function get_templates($slug = false)
{
$results = parent::get_many_by('slug', $slug);
$templates = array();
if (!empty($results)) {
foreach ($results as $template) {
$templates[$template->lang] = $template;
}
}
return $templates;
}
示例4: get_upcoming_matches
/**
* Gets only upcoming matches
* @return object Database object
*/
public function get_upcoming_matches($date = '')
{
if (empty($date)) {
parent::order_by('date', 'DESC');
$query = parent::get_many_by('status', 1);
} else {
$dateDay = date('d', strtotime($date));
$dateMonth = date('m', strtotime($date));
$dateYear = date('Y', strtotime($date));
$this->db->order_by('date', 'desc');
$this->db->where('status', 1);
$this->db->where('DAY(date)', $dateDay);
$this->db->where('MONTH(date)', $dateMonth);
$this->db->where('YEAR(date)', $dateYear);
$query = $this->db->get('matches')->result();
}
return $query;
}
示例5: delete_files
/**
* Delete multiple files
*
* Delete all files contained within a folder.
*
* @params int Folder id
* @return void
*/
public function delete_files($folder_id)
{
$this->load->helper('file');
$image = parent::get_many_by(array('folder_id' => $folder_id));
if (!$image) {
return FALSE;
}
foreach ($image as $item) {
@unlink(FCPATH . '/' . $this->config->item('files_folder') . '/' . $item->filename);
parent::delete($item->id);
}
return TRUE;
}
示例6: get_moderators
public function get_moderators($forumID = 0)
{
$this->_table = 'forum_moderators';
return parent::get_many_by('forum', $forumID);
}
示例7: get_featured_posts
public function get_featured_posts()
{
return parent::get_many_by('featured', 1);
}