@@ -19,6 +19,9 @@ discard block |
||
19 | 19 | } |
20 | 20 | } |
21 | 21 | |
22 | + /** |
|
23 | + * @param string $operator |
|
24 | + */ |
|
22 | 25 | public function add_constraint($name, $operator, $value) |
23 | 26 | { |
24 | 27 | try { |
@@ -40,7 +43,7 @@ discard block |
||
40 | 43 | } |
41 | 44 | |
42 | 45 | /** |
43 | - * @return midgard\portable\api\mgdobject[] |
|
46 | + * @return Generator |
|
44 | 47 | */ |
45 | 48 | public function iterate() |
46 | 49 | { |
@@ -509,6 +509,7 @@ discard block |
||
509 | 509 | } |
510 | 510 | |
511 | 511 | /** |
512 | + * @param integer $up |
|
512 | 513 | * @return QueryBuilder |
513 | 514 | */ |
514 | 515 | protected function get_uniquefield_query($classname, $field, $part, $upfield, $up) |
@@ -610,7 +611,7 @@ discard block |
||
610 | 611 | /** |
611 | 612 | * @param string $domain |
612 | 613 | * @param string $name |
613 | - * @param mixed $value |
|
614 | + * @param string $value |
|
614 | 615 | * @return boolean |
615 | 616 | */ |
616 | 617 | public function set_parameter($domain, $name, $value) |
@@ -816,6 +817,9 @@ discard block |
||
816 | 817 | return new \midgard_reflection_property(get_called_class()); |
817 | 818 | } |
818 | 819 | |
820 | + /** |
|
821 | + * @param string $guid |
|
822 | + */ |
|
819 | 823 | public function set_guid($guid) |
820 | 824 | { |
821 | 825 | parent::__set('guid', $guid); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | public function __get($field) |
82 | 82 | { |
83 | - if ( $field === 'metadata' |
|
83 | + if ($field === 'metadata' |
|
84 | 84 | && $this->metadata === null |
85 | 85 | && $this instanceof metadata_interface) { |
86 | 86 | $this->metadata = new metadata($this); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | foreach ($candidates as $candidate) { |
103 | 103 | if ($this->$candidate !== null) { |
104 | 104 | //Proxies become stale if the object itself is detached, so we have to re-fetch |
105 | - if ( $this->$candidate instanceof Proxy |
|
105 | + if ($this->$candidate instanceof Proxy |
|
106 | 106 | && $this->$candidate->__isInitialized()) { |
107 | 107 | try { |
108 | 108 | $this->$candidate->get_by_id($this->$candidate->id); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | // According to Doctrine documentation, proxies should be transparent, but in practice, |
132 | 132 | // there will be problems if we don't force-load |
133 | - if ( $entity instanceof Proxy |
|
133 | + if ($entity instanceof Proxy |
|
134 | 134 | && !$entity->__isInitialized()) { |
135 | 135 | try { |
136 | 136 | $entity->__load(); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | exception::duplicate(); |
184 | 184 | return false; |
185 | 185 | } |
186 | - if ( !$this->is_unique() |
|
186 | + if (!$this->is_unique() |
|
187 | 187 | || !$this->check_parent()) { |
188 | 188 | return false; |
189 | 189 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | midgard_connection::get_instance()->set_error(MGD_ERR_INVALID_PROPERTY_VALUE); |
240 | 240 | return false; |
241 | 241 | } |
242 | - if ( $check_dependencies |
|
242 | + if ($check_dependencies |
|
243 | 243 | && $this->has_dependents()) { |
244 | 244 | exception::has_dependants(); |
245 | 245 | return false; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | { |
331 | 331 | $this->initialize(); |
332 | 332 | |
333 | - if ( empty($this->cm->midgard['parentfield']) |
|
333 | + if (empty($this->cm->midgard['parentfield']) |
|
334 | 334 | || empty($this->cm->midgard['parent'])) { |
335 | 335 | return true; |
336 | 336 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $this->initialize(); |
348 | 348 | |
349 | 349 | foreach ($this->cm->fieldMappings as $name => $field) { |
350 | - if ( $field['midgard:midgard_type'] == translator::TYPE_GUID |
|
350 | + if ($field['midgard:midgard_type'] == translator::TYPE_GUID |
|
351 | 351 | && !empty($this->$name) |
352 | 352 | && !mgd_is_guid($this->$name)) { |
353 | 353 | exception::invalid_property_value("'" . $name . "' property's value is not a guid."); |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | |
360 | 360 | private function check_upfield() |
361 | 361 | { |
362 | - if ( !empty($this->id) |
|
362 | + if (!empty($this->id) |
|
363 | 363 | && !empty($this->cm->midgard['upfield']) |
364 | 364 | && $this->__get($this->cm->midgard['upfield']) === $this->id) { |
365 | 365 | exception::tree_is_circular(); |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $stat = ($results > 0); |
396 | 396 | } |
397 | 397 | |
398 | - if ( !$stat |
|
398 | + if (!$stat |
|
399 | 399 | && !empty($this->cm->midgard['childtypes'])) { |
400 | 400 | foreach ($this->cm->midgard['childtypes'] as $typename => $parentfield) { |
401 | 401 | $qb = connection::get_em()->createQueryBuilder(); |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | exception::not_exists(); |
755 | 755 | return false; |
756 | 756 | } |
757 | - if ( $check_dependencies |
|
757 | + if ($check_dependencies |
|
758 | 758 | && $this->has_dependents()) { |
759 | 759 | exception::has_dependants(); |
760 | 760 | return false; |