public function salvar() { $template = new sqlTemplates(); if ((int) $this->get_pk_template() > 0) { $template->editar_template($this); } else { $this->set_pk_template($template->cadastrar_template($this)); } }