isWindowsOs() && substr($structure['name'], 1, 2) !== ':/') || (!$this->isWindowsOs() && $structure['name'][0] !== '/') ) { throw new InvalidArgumentException( 'Root node expects absolute path as name', 1366141329 ); } $this->name = $structure['name']; if (isset($structure['targetPermission'])) { $this->setTargetPermission($structure['targetPermission']); } if (array_key_exists('children', $structure)) { $this->createChildren($structure['children']); } } /** * Get own status and status of child objects - Root node gives error status if not exists * * @return FlashMessage[] */ public function getStatus(): array { $result = []; if (!$this->exists()) { $result[] = new FlashMessage( '', $this->getAbsolutePath() . ' does not exist', ContextualFeedbackSeverity::ERROR ); } else { $result = $this->getSelfStatus(); } $result = array_merge($result, $this->getChildrenStatus()); return $result; } /** * Root node does not call parent, but returns own name only * * @return string Absolute path */ public function getAbsolutePath() { return $this->name; } }