| Total Complexity | 4 |
| Total Lines | 69 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Model extends \CI_Model |
||
| 14 | { |
||
| 15 | use Traits\CredoTrait; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Deletes the specified ID of the model from the database. |
||
| 19 | * |
||
| 20 | * @param integer $id |
||
| 21 | * @return void |
||
| 22 | */ |
||
| 23 | 3 | public function delete($id) |
|
| 30 | 3 | } |
|
| 31 | |||
| 32 | /** |
||
| 33 | * Inserts a new row into the table. |
||
| 34 | * |
||
| 35 | * @param array $data |
||
| 36 | * @return integer |
||
| 37 | */ |
||
| 38 | 3 | public function insert(array $data) |
|
| 39 | { |
||
| 40 | 3 | $metadata = $this->metadata((string) get_class($this)); |
|
| 41 | |||
| 42 | 3 | $this->db->insert($metadata->getTableName(), $data); |
|
| 43 | |||
| 44 | 3 | $item = $this->find($lastId = $this->db->insert_id()); |
|
|
|
|||
| 45 | |||
| 46 | 3 | $this->credo->refresh($item); |
|
| 47 | |||
| 48 | 3 | return $lastId; |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Updates the selected row from the table. |
||
| 53 | * |
||
| 54 | * @param integer $id |
||
| 55 | * @param array $data |
||
| 56 | * @return boolean |
||
| 57 | */ |
||
| 58 | 3 | public function update($id, array $data) |
|
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Returns the metadata of an entity. |
||
| 75 | * |
||
| 76 | * @param string $class |
||
| 77 | * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata |
||
| 78 | */ |
||
| 79 | 6 | protected function metadata($class) |
|
| 84 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.