1 | <?php |
||
24 | class Model extends DatabaseQuery implements ModelInterface |
||
25 | { |
||
26 | //Inject the inflector trait |
||
27 | use Inflector; |
||
28 | |||
29 | /** |
||
30 | * stripclassName() |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | public static function stripclassName() |
||
40 | |||
41 | /** |
||
42 | * getClassName() |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | public static function getClassName() |
||
50 | |||
51 | /** |
||
52 | * getTableName() |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | public static function getTableName($connection) |
||
60 | |||
61 | /** |
||
62 | * getALL() |
||
63 | * Get all record from the database |
||
64 | * |
||
65 | * @return object |
||
66 | */ |
||
67 | public function getALL($dbConnection = NULL) |
||
80 | |||
81 | /** |
||
82 | * where($data, $condition) |
||
83 | * Get data from database where $data = $condition |
||
84 | * |
||
85 | * @return object |
||
86 | */ |
||
87 | public function where($data, $condition = NULL, $dbConnection = NULL) |
||
101 | |||
102 | /** |
||
103 | * find($value) |
||
104 | * Find data from database where id = $value |
||
105 | * |
||
106 | * @return array |
||
107 | */ |
||
108 | public static function find($value, $dbConnection = NULL) |
||
124 | |||
125 | /** |
||
126 | * save() |
||
127 | * Insert data into database |
||
128 | * |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function save($dbConnection = NULL) |
||
145 | |||
146 | /** |
||
147 | * update() |
||
148 | * Update details in database after ::find(2) |
||
149 | * |
||
150 | * @return bool |
||
151 | */ |
||
152 | public function update($dbConnection = NULL) |
||
164 | |||
165 | /** |
||
166 | * destroy($value) |
||
167 | * Delete data from database |
||
168 | * |
||
169 | * @return bool |
||
170 | */ |
||
171 | public function destroy($value, $dbConnection = NULL) |
||
184 | } |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.