ZF\Apigility\Admin\Controller\DashboardController::settingsDashboardAction PHP Method

settingsDashboardAction() public method

    public function settingsDashboardAction()
    {
        $authentication = $this->authentication->fetch();
        if ($authentication) {
            $authenticationEntity = $authentication;
            $authentication = new Entity($authentication, null);
            $authentication->getLinks()->add(Link::factory(['rel' => 'self', 'route' => $this->getRouteForEntity($authenticationEntity)]));
        }
        $dbAdapters = new Collection($this->dbAdapters->fetchAll());
        $dbAdapters->setCollectionRoute('zf-apigility/api/db-adapter');
        $contentNegotiation = new Collection($this->contentNegotiation->fetchAll());
        $contentNegotiation->setCollectionRoute('zf-apigility/api/content-negotiation');
        $dashboard = ['authentication' => $authentication, 'content_negotiation' => $contentNegotiation, 'db_adapter' => $dbAdapters];
        $entity = new Entity($dashboard, 'settings-dashboard');
        $links = $entity->getLinks();
        $links->add(Link::factory(['rel' => 'self', 'route' => ['name' => 'zf-apigility/api/settings-dashboard']]));
        return new ViewModel(['payload' => $entity]);
    }