From: Stephen Cameron Date: Mon, 12 Aug 2019 13:20:31 +0000 (+0200) Subject: Allow fields to be removed from templates via removeField function. WIP #2738 @0:05 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c32928d07a5863300f1d44cc04eb7650d64e8898;p=cubist_cms-back.git Allow fields to be removed from templates via removeField function. WIP #2738 @0:05 --- diff --git a/src/app/Template/TemplateAbstract.php b/src/app/Template/TemplateAbstract.php index e8b1434..6660173 100644 --- a/src/app/Template/TemplateAbstract.php +++ b/src/app/Template/TemplateAbstract.php @@ -39,6 +39,16 @@ class TemplateAbstract $this->_fields[$attributes['name']] = $attributes; } + /** + * @param $field_name string + */ + public function removeField($field_name) + { + if (isset($this->_fields[$field_name])) { + unset($this->_fields[$field_name]); + } + } + /** * @return array */