@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | |
57 | 57 | /** |
58 | - * @param array $config |
|
58 | + * @param ModelWithIdAndState $config |
|
59 | 59 | * @return ModelEvent |
60 | 60 | */ |
61 | 61 | abstract protected function createEvent($config = []); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | *******************************************/ |
30 | 30 | |
31 | 31 | /** |
32 | - * @param array $config |
|
32 | + * @param ModelWithIdInterface $config |
|
33 | 33 | * @return ModelEvent |
34 | 34 | */ |
35 | 35 | abstract protected function createEvent($config = []); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public abstract function findByRecord(RecordInterface $record); |
45 | 45 | |
46 | 46 | /** |
47 | - * @param array $config |
|
47 | + * @param \flipbox\spark\records\Interfaces\RecordWithIdInterface $config |
|
48 | 48 | * @return ObjectInterface |
49 | 49 | */ |
50 | 50 | public abstract function create($config = []); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | /** |
57 | 57 | * @param $handle |
58 | - * @return ModelWithIdInterface|null |
|
58 | + * @return \flipbox\spark\objects\Interfaces\ObjectInterface|null |
|
59 | 59 | */ |
60 | 60 | public function freshFindByHandle($handle) |
61 | 61 | { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | /** |
81 | 81 | * @param $handle |
82 | - * @return ModelWithIdInterface|null |
|
82 | + * @return null|\flipbox\spark\objects\Interfaces\ObjectInterface |
|
83 | 83 | * @throws ObjectNotFoundException |
84 | 84 | */ |
85 | 85 | public function freshGetByHandle($handle) |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | /** |
104 | 104 | * @param $handle |
105 | - * @return ModelWithIdInterface|null |
|
105 | + * @return \flipbox\spark\objects\Interfaces\ObjectInterface|null |
|
106 | 106 | */ |
107 | 107 | public function findByHandle($handle) |
108 | 108 | { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | /** |
143 | 143 | * @param $handle |
144 | - * @return ModelWithIdInterface|null |
|
144 | + * @return null|\flipbox\spark\objects\Interfaces\ObjectInterface |
|
145 | 145 | * @throws ObjectNotFoundException |
146 | 146 | */ |
147 | 147 | public function getByHandle($handle) |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public abstract function findByRecord(RecordInterface $record); |
45 | 45 | |
46 | 46 | /** |
47 | - * @param array $config |
|
47 | + * @param \flipbox\spark\records\Interfaces\RecordWithIdInterface $config |
|
48 | 48 | * @return ObjectInterface |
49 | 49 | */ |
50 | 50 | public abstract function create($config = []); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | /** |
57 | 57 | * @param $id |
58 | - * @return ModelWithIdInterface|null |
|
58 | + * @return \flipbox\spark\objects\Interfaces\ObjectInterface|null |
|
59 | 59 | */ |
60 | 60 | public function freshFindById($id) |
61 | 61 | { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | /** |
81 | 81 | * @param $id |
82 | - * @return ModelWithIdInterface|null |
|
82 | + * @return null|\flipbox\spark\objects\Interfaces\ObjectInterface |
|
83 | 83 | * @throws ObjectNotFoundException |
84 | 84 | */ |
85 | 85 | public function freshGetById($id) |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | /** |
104 | 104 | * @param $id |
105 | - * @return ModelWithIdInterface|null |
|
105 | + * @return \flipbox\spark\objects\Interfaces\ObjectInterface|null |
|
106 | 106 | */ |
107 | 107 | public function findById($id) |
108 | 108 | { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | /** |
143 | 143 | * @param $id |
144 | - * @return ModelWithIdInterface|null |
|
144 | + * @return null|\flipbox\spark\objects\Interfaces\ObjectInterface |
|
145 | 145 | * @throws ObjectNotFoundException |
146 | 146 | */ |
147 | 147 | public function getById($id) |
@@ -23,7 +23,7 @@ |
||
23 | 23 | public static function resolveSiteId(int $siteId = null): int |
24 | 24 | { |
25 | 25 | |
26 | - if(is_null($siteId)) { |
|
26 | + if (is_null($siteId)) { |
|
27 | 27 | |
28 | 28 | $siteId = Craft::$app->getSites()->currentSite->id; |
29 | 29 |
@@ -25,12 +25,12 @@ |
||
25 | 25 | { |
26 | 26 | |
27 | 27 | // No bueno |
28 | - if(empty($config)) { |
|
28 | + if (empty($config)) { |
|
29 | 29 | return $query; |
30 | 30 | } |
31 | 31 | |
32 | 32 | // Force array |
33 | - if(!is_array($config)) { |
|
33 | + if (!is_array($config)) { |
|
34 | 34 | $config = ArrayHelper::toArray($config, [], false); |
35 | 35 | } |
36 | 36 |
@@ -106,7 +106,7 @@ |
||
106 | 106 | public static function conditionToCriteria($condition) |
107 | 107 | { |
108 | 108 | |
109 | - if(empty($condition)){ |
|
109 | + if (empty($condition)) { |
|
110 | 110 | return $condition; |
111 | 111 | } |
112 | 112 |
@@ -211,7 +211,7 @@ |
||
211 | 211 | // Resolve siteId |
212 | 212 | $siteId = $this->resolveSiteId($siteId); |
213 | 213 | |
214 | - if(!isset($this->_cacheByString[$siteId])) { |
|
214 | + if (!isset($this->_cacheByString[$siteId])) { |
|
215 | 215 | $this->_cacheByString[$siteId] = []; |
216 | 216 | } |
217 | 217 |
@@ -98,7 +98,7 @@ |
||
98 | 98 | * @param $identifier |
99 | 99 | * @param int|null $siteId |
100 | 100 | * @param string $scenario |
101 | - * @return Element|null |
|
101 | + * @return null|\craft\base\ElementInterface |
|
102 | 102 | */ |
103 | 103 | public function find($identifier, int $siteId = null, $scenario = ElementHelper::SCENARIO_DEFAULT) |
104 | 104 | { |
@@ -561,7 +561,7 @@ |
||
561 | 561 | // Resolve siteId |
562 | 562 | $siteId = SiteHelper::resolveSiteId($siteId); |
563 | 563 | |
564 | - if(!isset($this->_cacheById[$siteId])) { |
|
564 | + if (!isset($this->_cacheById[$siteId])) { |
|
565 | 565 | $this->_cacheById[$siteId] = []; |
566 | 566 | } |
567 | 567 |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @param $identifier |
152 | 152 | * @param int|null $siteId |
153 | 153 | * @param string $scenario |
154 | - * @return ElementInterface|null |
|
154 | + * @return null|\craft\base\ElementInterface |
|
155 | 155 | */ |
156 | 156 | public function find($identifier, int $siteId = null, $scenario = ElementHelper::DEFAULT_SCENARIO) |
157 | 157 | { |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | /** |
242 | 242 | * @param $criteria |
243 | 243 | * @param string $scenario |
244 | - * @return ElementInterface|null |
|
244 | + * @return null|\craft\base\ElementInterface |
|
245 | 245 | */ |
246 | 246 | public function findByCriteria($criteria, $scenario = ElementHelper::DEFAULT_SCENARIO) |
247 | 247 | { |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | * |
447 | 447 | * @param $criteria |
448 | 448 | * @param string $scenario |
449 | - * @return ElementInterface|null |
|
449 | + * @return null|\craft\base\ElementInterface |
|
450 | 450 | */ |
451 | 451 | public function findByQuery($criteria, $scenario = ElementHelper::DEFAULT_SCENARIO) |
452 | 452 | { |