Sulu\Bundle\ContentBundle\Admin\ContentAdmin::__construct PHP Метод

__construct() публичный Метод

public __construct ( Sulu\Component\Webspace\Manager\WebspaceManagerInterface $webspaceManager, Sulu\Component\Security\Authorization\SecurityCheckerInterface $securityChecker, Sulu\Component\PHPCR\SessionManager\SessionManagerInterface $sessionManager, $title )
$webspaceManager Sulu\Component\Webspace\Manager\WebspaceManagerInterface
$securityChecker Sulu\Component\Security\Authorization\SecurityCheckerInterface
$sessionManager Sulu\Component\PHPCR\SessionManager\SessionManagerInterface
    public function __construct(WebspaceManagerInterface $webspaceManager, SecurityCheckerInterface $securityChecker, SessionManagerInterface $sessionManager, $title)
    {
        $this->webspaceManager = $webspaceManager;
        $this->securityChecker = $securityChecker;
        $this->sessionManager = $sessionManager;
        $rootNavigationItem = new NavigationItem($title);
        $section = new NavigationItem('navigation.webspaces');
        $section->setPosition(10);
        $rootNavigationItem->addChild($section);
        $position = 10;
        /** @var Webspace $webspace */
        foreach ($this->webspaceManager->getWebspaceCollection() as $webspace) {
            if ($this->securityChecker->hasPermission(self::SECURITY_CONTEXT_PREFIX . $webspace->getKey(), PermissionTypes::VIEW)) {
                $webspaceItem = new NavigationItem($webspace->getName());
                $webspaceItem->setPosition($position++);
                $webspaceItem->setIcon('bullseye');
                $indexUuid = $this->sessionManager->getContentNode($webspace->getKey())->getIdentifier();
                $indexPageItem = new NavigationItem('navigation.webspaces.index-page');
                $indexPageItem->setPosition(10);
                $indexPageItem->setAction('content/contents/' . $webspace->getKey() . '/edit:' . $indexUuid . '/content');
                $webspaceItem->addChild($indexPageItem);
                $contentItem = new NavigationItem('navigation.webspaces.content');
                $contentItem->setPosition(20);
                $contentItem->setAction('content/contents/' . $webspace->getKey());
                $webspaceItem->addChild($contentItem);
                $webspaceSettingsItem = new NavigationItem('navigation.webspaces.settings');
                $webspaceSettingsItem->setPosition(30);
                $webspaceSettingsItem->setAction(sprintf('content/webspace/settings:%s/general', $webspace->getKey()));
                $webspaceItem->addChild($webspaceSettingsItem);
                $section->addChild($webspaceItem);
            }
        }
        $this->setNavigation(new Navigation($rootNavigationItem));
    }