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();
 }