/** * @param FacadeInterface $facade * @param NodeInterface $node * * @return FacadeInterface */ protected function addMainAttributes(FacadeInterface $facade, NodeInterface $node) { if ($site = $this->siteRepository->findOneBySiteId($node->getSiteId())) { $facade->templateSet = $site->getTemplateSet(); } $facade->id = $node->getId(); $facade->nodeId = $node->getNodeId(); $facade->name = $node->getName(); $facade->siteId = $node->getSiteId(); $facade->deleted = $node->isDeleted(); $facade->template = $node->getTemplate(); $facade->nodeType = $node->getNodeType(); $facade->parentId = $node->getParentId(); $facade->path = $node->getPath(); $facade->routePattern = $node->getRoutePattern(); $facade->language = $node->getLanguage(); $facade->metaDescription = $node->getMetaDescription(); $facade->metaIndex = $node->getMetaIndex(); $facade->metaFollow = $node->getMetaFollow(); $facade->theme = $node->getTheme(); $facade->themeSiteDefault = $node->hasDefaultSiteTheme(); $facade->version = $node->getVersion(); $facade->createdBy = $node->getCreatedBy(); $facade->updatedBy = $node->getUpdatedBy(); $facade->createdAt = $node->getCreatedAt(); $facade->updatedAt = $node->getUpdatedAt(); $facade->addRight('can_read', $this->authorizationChecker->isGranted(ContributionActionInterface::READ, $node)); return $facade; }