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);
}
}