M1\Vars\Resource\ResourceProvider::__construct PHP Method

__construct() public method

The ResourceProvider constructor creates the content from the entity
public __construct ( Vars $vars, string | array $entity, boolean $relative = true, boolean $recursive = false )
$vars M1\Vars\Vars The calling Vars class
$entity string | array The configuration entity
$relative boolean Is the entity relative to the calling entity or class
$recursive boolean If entity a dir, do you want to recursively check directories
    public function __construct(Vars $vars, $entity, $relative = true, $recursive = false)
    {
        if (!is_string($entity) && !is_array($entity)) {
            throw new \InvalidArgumentException('You can only pass strings or arrays as Resources');
        }
        $this->vars = $vars;
        $this->entity = $entity;
        $this->relative = $relative;
        $this->recursive = $recursive;
        $type = gettype($entity);
        $resources = $this->processEntity($entity, $type);
        $vars->variables->vstore->createPrefix($relative);
        if ($resources && !empty($resources)) {
            $this->createResources($resources, $type);
        }
    }