public function addField(SnippetTemplateField $field) { $field->setTemplate($this); $this->fields->add($field); $this->setModified(); return $this; }