Lines Matching defs:data
18 * Document data.
20 * @var array Document data
40 * @param array|string $data Data array
43 public function __construct(?string $id = null, $data = [], $index = '')
46 $this->setData($data);
99 * @throws InvalidException if the current document is a serialized data
104 throw new InvalidException('Document data is serialized data. Data creation is forbidden.');
187 * Overwrites the current document data with the given data.
189 * @param array|string $data Data array
191 public function setData($data): self
193 $this->_data = $data;
199 * Returns the document data.
201 * @return array|string Document data
259 * @param array|Document $data
261 * @throws InvalidException If invalid data has been provided
263 public static function create($data): self
265 if ($data instanceof self) {
266 return $data;
269 if (\is_array($data)) {
270 return new static('', $data);
273 throw new InvalidException('Failed to create document. Invalid data passed.');