Acl\AclExtras::_updateControllers PHP Method

_updateControllers() protected method

Updates a collection of controllers.
protected _updateControllers ( array $root, array $controllers, string $plugin = null, string $prefix = null ) : array
$root array Array or ACO information for root node.
$controllers array Array of Controllers
$plugin string Name of the plugin you are making controllers for.
$prefix string Name of the prefix you are making controllers for.
return array
    protected function _updateControllers($root, $controllers, $plugin = null, $prefix = null)
    {
        $pluginPath = $this->_pluginAlias($plugin);
        // look at each controller
        $controllersNames = [];
        foreach ($controllers as $controller) {
            $tmp = explode('/', $controller);
            $controllerName = str_replace('Controller.php', '', array_pop($tmp));
            if ($controllerName == 'App') {
                continue;
            }
            $controllersNames[] = $controllerName;
            $path = [$this->rootNode, $pluginPath, $prefix, $controllerName];
            $path = implode('/', Hash::filter($path));
            $controllerNode = $this->_checkNode($path, $controllerName, $root->id);
            $this->_checkMethods($controller, $controllerName, $controllerNode, $pluginPath, $prefix);
        }
        return $controllersNames;
    }