1 | <?php |
||
16 | class KeyedModel extends EntityModel { |
||
17 | protected $newProperties = array( |
||
18 | 'dbId' => array( |
||
19 | P_DB_FIELD => 'id', |
||
20 | ), |
||
21 | ); |
||
22 | |||
23 | public function __construct(\Common\GlobalContainer $gc) { |
||
26 | |||
27 | /** |
||
28 | * Exports object properties to DB row state WITHOUT ID |
||
29 | * |
||
30 | * Useful for INSERT operations |
||
31 | * |
||
32 | * @param \Entity\KeyedContainer $cEntity |
||
33 | */ |
||
34 | protected function exportRowNoId($cEntity) { |
||
41 | |||
42 | /** |
||
43 | * @param int|string $dbId |
||
44 | * |
||
45 | * @return KeyedContainer|false |
||
46 | */ |
||
47 | public function loadById($dbId) { |
||
58 | |||
59 | // protected function load(KeyedContainer $cEntity) { |
||
|
|||
60 | // throw new \Exception('EntityModel::dbSave() is not yet implemented'); |
||
61 | // } |
||
62 | // |
||
63 | protected function delete(KeyedContainer $cEntity) { |
||
69 | |||
70 | protected function insert(KeyedContainer $cEntity) { |
||
73 | |||
74 | protected function update(KeyedContainer $cEntity) { |
||
81 | |||
82 | protected function unchanged(KeyedContainer $cEntity){ |
||
87 | |||
88 | protected function emptyAction(KeyedContainer $cEntity) { |
||
93 | |||
94 | /** |
||
95 | * Gets entity's DB ID field name (which is unique within entity set) |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | public function getIdFieldName() { |
||
102 | |||
103 | } |
||
104 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.