@@ -41,8 +41,9 @@ discard block |
||
| 41 | 41 | public function editObject($changes) |
| 42 | 42 | { |
| 43 | 43 | // check if there's anything to do |
| 44 | - if (empty($changes) || $changes == $this->data) |
|
| 45 | - return true; |
|
| 44 | + if (empty($changes) || $changes == $this->data) { |
|
| 45 | + return true; |
|
| 46 | + } |
|
| 46 | 47 | |
| 47 | 48 | // extract the data and save appropriately to |
| 48 | 49 | // the associated database tables ... if any |
@@ -59,8 +60,9 @@ discard block |
||
| 59 | 60 | public function setDataSources($sources) |
| 60 | 61 | { |
| 61 | 62 | foreach ($sources as $key=>$value) { |
| 62 | - if (empty($value)) |
|
| 63 | - unset($sources[$key]); |
|
| 63 | + if (empty($value)) { |
|
| 64 | + unset($sources[$key]); |
|
| 65 | + } |
|
| 64 | 66 | } |
| 65 | 67 | $this->dataSourceIds = $sources; |
| 66 | 68 | } |
@@ -97,8 +99,9 @@ discard block |
||
| 97 | 99 | */ |
| 98 | 100 | protected function getDataSources() |
| 99 | 101 | { |
| 100 | - foreach ($this->dataSourceIds as $key=>$id) |
|
| 101 | - $this->dataSourceObjects[$key] = $this->getDds()->getObject($id); |
|
| 102 | + foreach ($this->dataSourceIds as $key=>$id) { |
|
| 103 | + $this->dataSourceObjects[$key] = $this->getDds()->getObject($id); |
|
| 104 | + } |
|
| 102 | 105 | } |
| 103 | 106 | |
| 104 | 107 | /** |
@@ -118,8 +121,9 @@ discard block |
||
| 118 | 121 | $object = array_merge($this->getAllowedFieldsForClass($object['_classType']), $object); |
| 119 | 122 | // now update the object with the data from daedalus |
| 120 | 123 | $data = $dds->getObject($object['_uuid']); |
| 121 | - if ($data) |
|
| 122 | - $object = array_replace($object, array_intersect_key($data, $object)); |
|
| 124 | + if ($data) { |
|
| 125 | + $object = array_replace($object, array_intersect_key($data, $object)); |
|
| 126 | + } |
|
| 123 | 127 | } |
| 124 | 128 | // recursively update if this is in a tree structure |
| 125 | 129 | if ($isTree && is_array($object)) { |
@@ -179,8 +183,9 @@ discard block |
||
| 179 | 183 | } |
| 180 | 184 | } |
| 181 | 185 | } |
| 182 | - if (count($relations)) |
|
| 183 | - $this->saveLinkedObjects($relations); |
|
| 186 | + if (count($relations)) { |
|
| 187 | + $this->saveLinkedObjects($relations); |
|
| 188 | + } |
|
| 184 | 189 | } |
| 185 | 190 | |
| 186 | 191 | /** |
@@ -216,8 +221,9 @@ discard block |
||
| 216 | 221 | $relations = $renderables[$subRenderable]['relations']; |
| 217 | 222 | foreach ($relations as $relation) { |
| 218 | 223 | $memberRef = $relation['memberRef']; |
| 219 | - if (!isset($extracted['__relations'][$objId][$memberRef])) |
|
| 220 | - $extracted['__relations'][$objId][$memberRef] = []; |
|
| 224 | + if (!isset($extracted['__relations'][$objId][$memberRef])) { |
|
| 225 | + $extracted['__relations'][$objId][$memberRef] = []; |
|
| 226 | + } |
|
| 221 | 227 | $extracted['__relations'][$objId][$memberRef] = array_merge($extracted['__relations'][$objId][$memberRef], $newObjectIds); |
| 222 | 228 | } |
| 223 | 229 | } |
@@ -259,8 +265,9 @@ discard block |
||
| 259 | 265 | if (empty($fieldsForClass[$classType])) { |
| 260 | 266 | $definition = $this->getDefinition(); |
| 261 | 267 | foreach ($definition['renderables'] as $r) { |
| 262 | - if ($r['type'] == 'MemberComponent') |
|
| 263 | - $fieldsForClass[$r['class_type']][$r['member_ref']] = null; |
|
| 268 | + if ($r['type'] == 'MemberComponent') { |
|
| 269 | + $fieldsForClass[$r['class_type']][$r['member_ref']] = null; |
|
| 270 | + } |
|
| 264 | 271 | } |
| 265 | 272 | } |
| 266 | 273 | return $fieldsForClass[$classType]; |
@@ -322,8 +329,9 @@ discard block |
||
| 322 | 329 | if (isset($renderables[$phoebeKey])) { |
| 323 | 330 | // check the renderable exists and is a class component |
| 324 | 331 | $ren = $renderables[$phoebeKey]; |
| 325 | - if ($ren['type'] != 'ClassComponent') |
|
| 326 | - continue; |
|
| 332 | + if ($ren['type'] != 'ClassComponent') { |
|
| 333 | + continue; |
|
| 334 | + } |
|
| 327 | 335 | |
| 328 | 336 | // create the object and any required data params |
| 329 | 337 | $object = [ |
@@ -334,8 +342,9 @@ discard block |
||
| 334 | 342 | foreach ($ren['items'] as $item) { |
| 335 | 343 | if (isset($renderables[$item])) { |
| 336 | 344 | $iRen = $renderables[$item]; |
| 337 | - if ($iRen['type'] != 'MemberComponent') |
|
| 338 | - continue; |
|
| 345 | + if ($iRen['type'] != 'MemberComponent') { |
|
| 346 | + continue; |
|
| 347 | + } |
|
| 339 | 348 | $object[$iRen['member_ref']] = null; |
| 340 | 349 | } |
| 341 | 350 | } |
@@ -455,8 +464,9 @@ discard block |
||
| 455 | 464 | private $_class = null; |
| 456 | 465 | private function getClass() |
| 457 | 466 | { |
| 458 | - if (!$this->_class) |
|
| 459 | - $this->_class = neon('phoebe')->getIPhoebeType($this->phoebeType)->getClass($this->classType); |
|
| 467 | + if (!$this->_class) { |
|
| 468 | + $this->_class = neon('phoebe')->getIPhoebeType($this->phoebeType)->getClass($this->classType); |
|
| 469 | + } |
|
| 460 | 470 | return $this->_class; |
| 461 | 471 | } |
| 462 | 472 | |
@@ -469,8 +479,9 @@ discard block |
||
| 469 | 479 | private $_dds = null; |
| 470 | 480 | private function getDds() |
| 471 | 481 | { |
| 472 | - if (!$this->_dds) |
|
| 473 | - $this->_dds = neon('dds')->getIDdsObjectManagement(); |
|
| 482 | + if (!$this->_dds) { |
|
| 483 | + $this->_dds = neon('dds')->getIDdsObjectManagement(); |
|
| 484 | + } |
|
| 474 | 485 | return $this->_dds; |
| 475 | 486 | } |
| 476 | 487 | |