public function delete() { self::$object = "TemplateField"; self::$table = "pcms_template_field"; if (class_exists("AuditLog")) { AuditLog::addLog(AUDIT_TYPE_TEMPLATEFIELD, $this->getId(), $this->getName(), "delete", $this->getTemplateId()); } $objElementField = ElementField::deleteByTemplateId($this->id); return parent::delete(); }