site initialized; basic catalog lists videos
[living-lab-site.git] / application / models / videos_model.php
1 <?php
2
3 /**
4  * Class Videos_model models videos information from the DB
5  *
6  * @category    Model
7  * @author              Călin-Andrei Burloiu
8  */
9 class Videos_model extends CI_Model {
10         private $db = NULL;
11         
12         function __construct()
13         {
14                 if ($this->db === NULL)
15                 {
16                         $this->load->library('singleton_db');
17                         $this->db = $this->singleton_db->connect();
18                 }
19         }
20         
21         function getVideosSummary()
22         {
23                 return $this->db->get('videos');
24         }
25         
26         function getVideo($id, $name = NULL)
27         {
28                 return $this->db->query('SELECT * from videos WHERE id = ?', $id);
29         }
30 }
31
32 /* End of file videos_model.php */
33 /* Location: ./application/models/videos_model.php */