Acl\Adapter\Utility\PhpAco::build PHP Method

build() public method

build a tree representation from the given allow/deny informations for ACO paths
public build ( array $allow, array $deny = [] ) : void
$allow array ACO allow rules
$deny array ACO deny rules
return void
    public function build(array $allow, array $deny = [])
    {
        $this->_tree = [];
        foreach ($allow as $dotPath => $aros) {
            if (is_string($aros)) {
                $aros = array_map('trim', explode(',', $aros));
            }
            $this->access($aros, $dotPath, null, 'allow');
        }
        foreach ($deny as $dotPath => $aros) {
            if (is_string($aros)) {
                $aros = array_map('trim', explode(',', $aros));
            }
            $this->access($aros, $dotPath, null, 'deny');
        }
    }