1 | <?php |
||
18 | class Base |
||
19 | { |
||
20 | /** Deletion flag field name */ |
||
21 | const DELETE_FLAG_FIELD = 'Active'; |
||
22 | |||
23 | /** @var QueryInterface Database query instance */ |
||
24 | protected $query; |
||
25 | |||
26 | /** @var string Entity identifier */ |
||
27 | protected $identifier; |
||
28 | |||
29 | /** @var string Entity primary field name */ |
||
30 | protected $primaryField; |
||
31 | |||
32 | /** @var string Related entity primary field */ |
||
33 | protected $relationPrimary; |
||
34 | |||
35 | /** @var string Relation entity identifier */ |
||
36 | protected $relationIdentifier; |
||
37 | |||
38 | /** |
||
39 | * Entity constructor. |
||
40 | * @param QueryInterface $query Database query instance |
||
41 | * @param string $identifier Entity identifier |
||
42 | * @param string $relationPrimary Relation entity primary field name |
||
43 | * @param string $relationIdentifier Relation entity identifier |
||
44 | */ |
||
45 | public function __construct(QueryInterface $query, $identifier, $relationPrimary, $relationIdentifier) |
||
53 | |||
54 | /** |
||
55 | * Get current entity identifiers collection by navigation identifier. |
||
56 | * |
||
57 | * @param string $relationID Relation entity identifier |
||
58 | * @param mixed $relationValue Relation entity value |
||
59 | * @param array $filteringIDs Collection of entity identifiers for filtering query |
||
60 | * @return array Collection of entity identifiers filtered by navigation identifier. |
||
61 | */ |
||
62 | public function idsByRelationID($relationID, $relationValue = null, $filteringIDs = null) |
||
78 | |||
79 | /** |
||
80 | * Get current entity instances collection by their identifiers. |
||
81 | * Method can accept different query executors. |
||
82 | * |
||
83 | * @param string|array $entityIDs Entity identifier or their collection |
||
84 | * @param string $executor Method name for query execution |
||
85 | * @return mixed[] Collection of entity instances |
||
86 | */ |
||
87 | public function byIDs($entityIDs, $executor) |
||
94 | |||
95 | /** |
||
96 | * Retrieve entities from database. |
||
97 | * |
||
98 | * @param string|array $relationID Relation entity identifier or collection |
||
99 | * @param mixed $relationValue Relation entity value |
||
100 | * @param string $executor Query execution function name |
||
101 | * @return mixed[] Collection of entity instances for this relation identifier |
||
102 | */ |
||
103 | protected function retrieve($relationID, $relationValue, $executor) |
||
113 | |||
114 | /** |
||
115 | * Get current entity instances collection by navigation identifier. |
||
116 | * |
||
117 | * @param string $relationID Relation entity identifier |
||
118 | * @param mixed $relationValue Relation entity value |
||
119 | * @return mixed[] Collection of entity instances |
||
120 | */ |
||
121 | public function byRelationID($relationID, $relationValue = null) |
||
125 | |||
126 | /** |
||
127 | * Get current entity instances amount by navigation identifier. |
||
128 | * |
||
129 | * @param string $relationID Relation entity identifier |
||
130 | * @param mixed $relationValue Relation entity value |
||
131 | * @return integer Amount of entities related to Navigation identifier |
||
132 | */ |
||
133 | public function amountByRelationID($relationID, $relationValue = null) |
||
137 | } |
||
138 |
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: