public function setTemplateOptions($options)
    {
        $this->areTemplateOptionsFinalized = false;

        if (is_numeric($options)) {
            $options = null;
        } elseif (is_string($options)) {
            $options = json_decode($options, true);
        }

        $this->templateOptions = $options;

        return $this;
    }