public function __construct($tplResource, $brainy, $parent = null, $compileID = null, $suppressData = false)
{
if ($parent === null || !$suppressData) {
parent::__construct($brainy);
} else {
// Copied from the TemplateBase constructor
$this->smarty = $brainy;
}
$this->compile_id = $compileID ?: $this->smarty->compile_id;
$this->parent = $parent;
// Template resource
$this->template_resource = $tplResource;
$this->smarty->fetchedTemplate($tplResource);
$this->source = \Box\Brainy\Resources\Resource::source($this, $brainy, $this->template_resource);
$this->compiled = $this->source->getCompiled($this);
if (!$suppressData && $this->parent) {
if (is_array($this->parent)) {
$this->applyDataFrom($this->parent, false);
} else {
$this->cloneDataFrom($this->parent, false);
}
}
}