/**
  * (non-PHPdoc)
  * @see AttributeForm::validateAttributeNameDoesNotExists()
  */
 public function validateAttributeNameDoesNotExists()
 {
     assert('$this->modelClassName != null');
     parent::validateAttributeNameDoesNotExists();
     try {
         $models = DropDownDependencyDerivedAttributeMetadata::getByNameAndModelClassName($this->attributeName, $this->modelClassName);
         $this->addError('attributeName', Zurmo::t('DesignerModule', 'A field with this name is already used.'));
     } catch (NotFoundException $e) {
     }
 }
Esempio n. 2
0
 /**
  * Override to handle the case when the attributeName was already created used in another module
  */
 public function validateAttributeNameDoesNotExists()
 {
     parent::validateAttributeNameDoesNotExists();
     if (CustomFieldData::getByName($this->attributeName, false)->id > 0) {
         $this->addError('attributeName', Zurmo::t('DesignerModule', 'A field with this name and data is already used in another module.'));
     }
 }