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 | /** |
||
60 | * @param KeyedContainer $cEntity |
||
61 | * |
||
62 | * @throws \Exception |
||
63 | */ |
||
64 | protected function delete($cEntity) { |
||
69 | |||
70 | /** |
||
71 | * @param KeyedContainer $cEntity |
||
72 | */ |
||
73 | protected function insert($cEntity) { |
||
76 | |||
77 | /** |
||
78 | * @param KeyedContainer $cEntity |
||
79 | * |
||
80 | * @throws \Exception |
||
81 | */ |
||
82 | protected function update($cEntity) { |
||
89 | |||
90 | /** |
||
91 | * @param KeyedContainer $cEntity |
||
92 | */ |
||
93 | protected function onSaveUnchanged($cEntity){ |
||
98 | |||
99 | /** |
||
100 | * @param KeyedContainer $cEntity |
||
101 | */ |
||
102 | protected function onSaveNew($cEntity) { |
||
107 | |||
108 | /** |
||
109 | * Gets entity's DB ID field name (which is unique within entity set) |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | public function getIdFieldName() { |
||
116 | |||
117 | } |
||
118 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: