File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55/**
66 * Interface DataObject
77 *
8- * DataObject defines the basic interface to work as a data container for Repositories.
9- * It must be filled by an Array and cast to Array, it's also needs a unique id.
10- * @package Saedyousef\Contracts
8+ * DataObject defines the basic interface to work as a data container.
9+ * It should be filled by an Array and cast to Array, it's also needs a unique id.
1110 */
1211interface DataObject extends Identifiable, Hydrable, Arrayable
1312{
Original file line number Diff line number Diff line change 22
33namespace SY \DataObject \Contracts ;
44
5- /**
6- * Interface Hydrable
7- *
8- * This marks objects that can be filled by an array. This is mainly used for
9- * ORM or Data Object, which have to be filled by a Repository.
10- *
11- * @package Saedyousef\SupremeObject\Contracts
12- */
135interface Hydrable
146{
157
168 /**
17- * Hydrate the object by the $ data. Completely clears the object, and refill it .
9+ * Clear the data and refill the object.
1810 *
1911 * @param array $data
20- *
2112 * @return void
2213 */
2314 public function hydrate (array $ data );
@@ -26,8 +17,7 @@ public function hydrate(array $data);
2617 * Fill the object by the array. Don't clear the object before filling it.
2718 *
2819 * @param array $data
29- *
3020 * @return self
3121 */
32- public function apply (array $ data );
22+ public function apply (array $ data ): Hydrable ;
3323}
You can’t perform that action at this time.
0 commit comments