1 | <?php declare(strict_types=1); |
||
16 | class Record implements RenderInterface, \ArrayAccess, RecordInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var array Collection of instances for caching |
||
20 | * @deprecated |
||
21 | */ |
||
22 | public static $instances = array(); |
||
23 | |||
24 | /** |
||
25 | * Collection of class fields that would not be passed to module view |
||
26 | * @deprecated |
||
27 | */ |
||
28 | public static $restricted = array('attached', 'oneToOne', 'oneToMany', 'value'); |
||
29 | |||
30 | /** |
||
31 | * @var array Collection of joined entities |
||
32 | * @deprecated |
||
33 | */ |
||
34 | public $joined = []; |
||
35 | /** |
||
36 | * @var string Entity class name |
||
37 | * @deprecated |
||
38 | */ |
||
39 | public $className; |
||
40 | /** |
||
41 | * @var array Related OTO records grouped by entity class name |
||
42 | * @deprecated |
||
43 | */ |
||
44 | public $oneToOne = array(); |
||
45 | /** |
||
46 | * @var array Related OTM records grouped by entity class name |
||
47 | * @deprecated |
||
48 | */ |
||
49 | public $oneToMany = array(); |
||
50 | /** |
||
51 | * @var bool Flag if this object has a database record |
||
52 | * @deprecated |
||
53 | */ |
||
54 | public $attached = false; |
||
55 | |||
56 | /** @var DatabaseInterface Database layer */ |
||
57 | protected $database; |
||
58 | /** @var TableMetadata */ |
||
59 | protected $metadata; |
||
60 | /** @var int Identifier */ |
||
61 | public $id; |
||
62 | |||
63 | /** |
||
64 | * Record constructor. |
||
65 | * |
||
66 | * @param DatabaseInterface|null $database |
||
67 | */ |
||
68 | public function __construct(DatabaseInterface $database = null, TableMetadata $metadata = null) |
||
86 | |||
87 | /** |
||
88 | * Find database record by primary key value. |
||
89 | * This is generic method that should be used in nested classes to find its |
||
90 | * records by some its primary key value. |
||
91 | * |
||
92 | * @param QueryInterface $query Query object instance |
||
93 | * @param string $identifier Primary key value |
||
94 | * @param mixed $return Variable to return found database record |
||
95 | * @return bool|null|self Record instance or null if 3rd parameter not passed |
||
96 | * @deprecated Record should not be queryable, query class ancestor must be used |
||
97 | */ |
||
98 | public static function byID(QueryInterface $query, $identifier, &$return = null) |
||
114 | |||
115 | /** |
||
116 | * Find database record by column name and its value. |
||
117 | * This is generic method that should be used in nested classes to find its |
||
118 | * records by some its column values. |
||
119 | * |
||
120 | * @param QueryInterface $query Query object instance |
||
121 | * @param string $columnValue Column name for searching in calling class |
||
122 | * @param string $columnName Column value |
||
123 | * @return null|self Record instance if it was found and 4th variable has NOT been passed, |
||
124 | * NULL if record has NOT been found and 4th variable has NOT been passed |
||
125 | * @deprecated Record should not be queryable, query class ancestor must be used |
||
126 | */ |
||
127 | public static function oneByColumn(QueryInterface $query, $columnName, $columnValue) |
||
134 | |||
135 | /** |
||
136 | * Find database record collection by column name and its value. |
||
137 | * This is generic method that should be used in nested classes to find its |
||
138 | * records by some its column values. |
||
139 | * |
||
140 | * @param QueryInterface $query Query object instance |
||
141 | * @param string $columnName Column name for searching in calling class |
||
142 | * @param mixed $columnValue Column value |
||
143 | * @return self[] Record instance if it was found and 4th variable has NOT been passed, |
||
144 | * NULL if record has NOT been found and 4th variable has NOT been passed |
||
145 | * @deprecated Record should not be queryable, query class ancestor must be used |
||
146 | */ |
||
147 | public static function collectionByColumn(QueryInterface $query, $columnName, $columnValue) |
||
154 | |||
155 | /** @see idbRecord::delete() */ |
||
156 | public function delete() |
||
163 | |||
164 | /** Special method called when object has been filled with data */ |
||
165 | public function filled() |
||
169 | |||
170 | /** |
||
171 | * Обработчик клонирования записи |
||
172 | * Этот метод выполняется при системном вызове функции clone |
||
173 | * и выполняет создание записи в БД и привязку клонированного объекта к ней |
||
174 | * @deprecated Data entites should be cloned normally |
||
175 | */ |
||
176 | public function __clone() |
||
187 | |||
188 | /** |
||
189 | * @see idbRecord::save() |
||
190 | */ |
||
191 | public function save() |
||
220 | |||
221 | /** |
||
222 | * @see idbRecord::create() |
||
223 | * @deprecated |
||
224 | */ |
||
225 | public function create() |
||
228 | |||
229 | /** |
||
230 | * @see \samson\core\iModuleViewable::toView() |
||
231 | * @deprecated |
||
232 | */ |
||
233 | public function toView($prefix = null, array $restricted = array()) |
||
252 | |||
253 | /** |
||
254 | * Create full entity copy from |
||
255 | * @param mixed $object Variable to return copied object |
||
256 | * @return Record New copied object |
||
257 | * @deprecated Not supported yet |
||
258 | */ |
||
259 | public function ©(&$object = null) |
||
286 | |||
287 | public function __isset($name) |
||
291 | |||
292 | public function __set($name, $value) |
||
296 | |||
297 | public function __get($name) |
||
301 | |||
302 | /** |
||
303 | * @see ArrayAccess::offsetSet() |
||
304 | * @throws \InvalidArgumentException |
||
305 | */ |
||
306 | public function offsetSet($offset, $value) |
||
315 | |||
316 | /** |
||
317 | * @see ArrayAccess::offsetGet() |
||
318 | * @throws \InvalidArgumentException |
||
319 | */ |
||
320 | public function offsetGet($offset) |
||
329 | |||
330 | /** @see ArrayAccess::offsetUnset() */ |
||
331 | public function offsetUnset($offset) |
||
335 | |||
336 | /** @see ArrayAccess::offsetExists() */ |
||
337 | public function offsetExists($offset) |
||
341 | } |
||
342 |
This property has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.