@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @param mixed $id The object id (identifier / primary key value). |
43 | 43 | * @throws InvalidArgumentException If the argument is not scalar. |
44 | - * @return StorableInterface Chainable |
|
44 | + * @return StorableTrait Chainable |
|
45 | 45 | */ |
46 | 46 | public function setId($id) |
47 | 47 | { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @param string $key The object key, or identifier "name". |
87 | 87 | * @throws InvalidArgumentException If the argument is not scalar. |
88 | - * @return StorableInterface Chainable |
|
88 | + * @return StorableTrait Chainable |
|
89 | 89 | */ |
90 | 90 | public function setKey($key) |
91 | 91 | { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | /** |
123 | 123 | * @param FactoryInterface $factory The source factory, which is useful to create source. |
124 | - * @return StorableInterface Chainable |
|
124 | + * @return StorableTrait Chainable |
|
125 | 125 | */ |
126 | 126 | protected function setSourceFactory(FactoryInterface $factory) |
127 | 127 | { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * Set the object's source. |
148 | 148 | * |
149 | 149 | * @param SourceInterface $source The storable object's source. |
150 | - * @return StorableInterface Chainable |
|
150 | + * @return StorableTrait Chainable |
|
151 | 151 | * @todo This method needs to go protected. |
152 | 152 | */ |
153 | 153 | public function setSource(SourceInterface $source) |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * Load an object from the database from its ID. |
181 | 181 | * |
182 | 182 | * @param mixed $id The identifier to load. |
183 | - * @return StorableInterface Chainable |
|
183 | + * @return StorableTrait Chainable |
|
184 | 184 | */ |
185 | 185 | public function load($id = null) |
186 | 186 | { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * |
197 | 197 | * @param string $key Key pointing a column's name. |
198 | 198 | * @param mixed $value Value of said column. |
199 | - * @return StorableInterface Chainable. |
|
199 | + * @return StorableTrait Chainable. |
|
200 | 200 | */ |
201 | 201 | public function loadFrom($key = null, $value = null) |
202 | 202 | { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * |
210 | 210 | * @param string $query The SQL query. |
211 | 211 | * @param array $binds Optional. The SQL query parameters. |
212 | - * @return StorableInterface Chainable. |
|
212 | + * @return StorableTrait Chainable. |
|
213 | 213 | */ |
214 | 214 | public function loadFromQuery($query, array $binds = []) |
215 | 215 | { |
@@ -281,7 +281,7 @@ |
||
281 | 281 | $properties = array_keys($model->metadata()->properties()); |
282 | 282 | } else { |
283 | 283 | // Ensure the key is always in the required fields. |
284 | - $properties = array_merge($properties, [ $model->key() ]); |
|
284 | + $properties = array_merge($properties, [$model->key()]); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | $fields = []; |
@@ -27,5 +27,5 @@ |
||
27 | 27 | * @param ValidatorInterface $v Optional. A custom validator object to use for validation. If null, use object's. |
28 | 28 | * @return boolean |
29 | 29 | */ |
30 | - public function validate(ValidatorInterface &$v = null); |
|
30 | + public function validate(ValidatorInterface&$v = null); |
|
31 | 31 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | * @param ValidatorInterface $v Optional. A custom validator object to use for validation. If null, use object's. |
49 | 49 | * @return boolean |
50 | 50 | */ |
51 | - public function validate(ValidatorInterface &$v = null) |
|
51 | + public function validate(ValidatorInterface&$v = null) |
|
52 | 52 | { |
53 | 53 | if ($v !== null) { |
54 | 54 | $this->setValidator($v); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * Retrieve the source to load objects from. |
154 | 154 | * |
155 | 155 | * @throws RuntimeException If no source has been defined. |
156 | - * @return mixed |
|
156 | + * @return SourceInterface |
|
157 | 157 | */ |
158 | 158 | public function source() |
159 | 159 | { |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | * Retrieve the object model. |
201 | 201 | * |
202 | 202 | * @throws RuntimeException If no model has been defined. |
203 | - * @return Model |
|
203 | + * @return ModelInterface |
|
204 | 204 | */ |
205 | 205 | public function model() |
206 | 206 | { |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | * Alias of {@see SourceInterface::setFilters()} |
362 | 362 | * |
363 | 363 | * @param array $filters An array of filters. |
364 | - * @return Collection Chainable |
|
364 | + * @return CollectionLoader Chainable |
|
365 | 365 | */ |
366 | 366 | public function setFilters(array $filters) |
367 | 367 | { |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | /** |
427 | 427 | * Alias of {@see SourceInterface::pagination()} |
428 | 428 | * |
429 | - * @return Pagination |
|
429 | + * @return \Charcoal\Source\PaginationInterface |
|
430 | 430 | */ |
431 | 431 | public function pagination() |
432 | 432 | { |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | * |
713 | 713 | * @param string $className The class name of the collection. |
714 | 714 | * @throws InvalidArgumentException If the class name is not a string. |
715 | - * @return AbstractPropertyDisplay Chainable |
|
715 | + * @return CollectionLoader Chainable |
|
716 | 716 | */ |
717 | 717 | public function setCollectionClass($className) |
718 | 718 | { |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | */ |
632 | 632 | protected function processCollection($results, callable $before = null, callable $after = null) |
633 | 633 | { |
634 | - $collection = $this->createCollection(); |
|
634 | + $collection = $this->createCollection(); |
|
635 | 635 | foreach ($results as $objData) { |
636 | 636 | $obj = $this->processModel($objData, $before, $after); |
637 | 637 | |
@@ -662,13 +662,13 @@ discard block |
||
662 | 662 | $obj = $this->factory()->create($objType); |
663 | 663 | |
664 | 664 | if ($before !== null) { |
665 | - call_user_func_array($before, [ &$obj ]); |
|
665 | + call_user_func_array($before, [&$obj]); |
|
666 | 666 | } |
667 | 667 | |
668 | 668 | $obj->setFlatData($objData); |
669 | 669 | |
670 | 670 | if ($after !== null) { |
671 | - call_user_func_array($after, [ &$obj ]); |
|
671 | + call_user_func_array($after, [&$obj]); |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | return $obj; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | /** |
88 | 88 | * @param FactoryInterface $factory The factory to use to create models. |
89 | - * @return ModelLoaderBuilder Chainable |
|
89 | + * @return ModelBuilder Chainable |
|
90 | 90 | */ |
91 | 91 | private function setFactory(FactoryInterface $factory) |
92 | 92 | { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | /** |
98 | 98 | * @param MetadataLoader $loader The loader instance, used to load metadata. |
99 | - * @return DescribableInterface Chainable |
|
99 | + * @return ModelBuilder Chainable |
|
100 | 100 | */ |
101 | 101 | private function setMetadataLoader(MetadataLoader $loader) |
102 | 102 | { |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | /** |
108 | 108 | * @param FactoryInterface $factory The factory to use to create models. |
109 | - * @return ModelLoaderBuilder Chainable |
|
109 | + * @return ModelBuilder Chainable |
|
110 | 110 | */ |
111 | 111 | private function setSourceFactory(FactoryInterface $factory) |
112 | 112 | { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * (A class name or object identifier). |
120 | 120 | * @param string|null $metadataIdent Optional. The metadata identifier to load. |
121 | 121 | * If NULL, it will be implied from objType. |
122 | - * @return MetadataInterface |
|
122 | + * @return \Charcoal\Model\MetadataInterface |
|
123 | 123 | */ |
124 | 124 | private function createMetadata($objType, $metadataIdent = null) |
125 | 125 | { |