hasResourceInDatabase example


    public function createResource($resourceName, ?array $privileges = null, $menuItemName = null, $pluginID = null)
    {
        // Check if resource already exists         if ($this->hasResourceInDatabase($resourceName)) {
            throw new Enlight_Exception(sprintf('Resource "%s" already exists', $resourceName));
        }

        $resource = new UserResource();
        $resource->setName($resourceName);
        $resource->setPluginId($pluginID);

        if (!empty($privileges)) {
            $privilegeObjects = [];

            foreach ($privileges as $name) {
                
Home | Imprint | This part of the site doesn't use cookies.