@@ -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 | && $this->cm->getAssociationMapping($this->cm->midgard['upfield'])['targetEntity'] === $this->cm->getName()) { |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | $stat = ($results > 0); |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | - if ( !$stat |
|
| 399 | + if (!$stat |
|
| 400 | 400 | && !empty($this->cm->midgard['childtypes'])) { |
| 401 | 401 | foreach ($this->cm->midgard['childtypes'] as $typename => $parentfield) { |
| 402 | 402 | $qb = connection::get_em()->createQueryBuilder(); |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | exception::not_exists(); |
| 756 | 756 | return false; |
| 757 | 757 | } |
| 758 | - if ( $check_dependencies |
|
| 758 | + if ($check_dependencies |
|
| 759 | 759 | && $this->has_dependents()) { |
| 760 | 760 | exception::has_dependants(); |
| 761 | 761 | return false; |