| 1 | <?php |
||
| 13 | class CodeigniterModel extends \CI_Model |
||
| 14 | { |
||
| 15 | use Traits\ModelTrait; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var \Rougin\Wildfire\Wildfire |
||
| 19 | */ |
||
| 20 | protected $wildfire; |
||
| 21 | |||
| 22 | 15 | public function __construct() |
|
| 28 | |||
| 29 | /** |
||
| 30 | * Returns all of the models from the database. |
||
| 31 | * |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | 3 | public function all() |
|
| 38 | |||
| 39 | /** |
||
| 40 | * Deletes the specified ID of the model from the database. |
||
| 41 | * |
||
| 42 | * @param integer $id |
||
| 43 | * @return void |
||
| 44 | */ |
||
| 45 | 3 | public function delete($id) |
|
| 51 | |||
| 52 | /** |
||
| 53 | * Finds the specified model from the database. |
||
| 54 | * |
||
| 55 | * @param integer $id |
||
| 56 | * @return mixed |
||
| 57 | */ |
||
| 58 | 9 | public function find($id) |
|
| 62 | |||
| 63 | /** |
||
| 64 | * Finds the specified model from the database by the given delimiters. |
||
| 65 | * |
||
| 66 | * @param array $delimiters |
||
| 67 | * @return mixed |
||
| 68 | */ |
||
| 69 | 3 | public function find_by(array $delimiters) |
|
| 70 | { |
||
| 71 | 3 | $this->db->where($delimiters); |
|
| 72 | |||
| 73 | 3 | return $this->get()->result(); |
|
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * Returns all rows from the specified table. |
||
| 78 | * |
||
| 79 | * @return self |
||
| 80 | */ |
||
| 81 | 3 | public function get() |
|
| 85 | } |
||
| 86 |