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); } }
/** * * @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; }
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; }
/** * 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; }
/** * 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; }
public function get_moderators($forumID = 0) { $this->_table = 'forum_moderators'; return parent::get_many_by('forum', $forumID); }
public function get_featured_posts() { return parent::get_many_by('featured', 1); }