예제 #1
0
 /**
  * @return array
  */
 function jsonSerialize()
 {
     $subSystems = array();
     foreach ($this->children as $subSystem) {
         $subSystems[$subSystem->getId()] = $subSystem->jsonSerialize();
     }
     if ($this->parent) {
         $parent = $this->parent->getId();
     } else {
         $parent = false;
     }
     return ['id' => $this->id, 'identifier' => $this->getIdentifier(), 'name' => $this->getName(), 'url' => $this->getUrl(), 'parent' => $parent, 'project' => $this->getProject()->getIdentifier(), 'image' => $this->getImage(), 'subSystems' => $subSystems, 'project' => $this->project->jsonSerialize(), 'active' => $this->isActive()];
 }