예제 #1
0
 public function rules()
 {
     return array(array('attributeName', 'required'), array('attributeName', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/', 'message' => Zurmo::t('DesignerModule', 'Name must not contain spaces or special characters')), array('attributeName', 'match', 'pattern' => '/^[a-z]/', 'message' => Zurmo::t('DesignerModule', 'First character must be a lower case letter')), array('attributeName', 'length', 'max' => DatabaseCompatibilityUtil::getDatabaseMaxColumnNameLength(), 'on' => "createAttribute"), array('attributeName', 'validateIsAttributeNameDatabaseReservedWord'), array('attributeLabels', 'validateAttributeLabels'), array('defaultValue', 'safe'), array('isAudited', 'boolean'), array('isRequired', 'boolean'), array('attributeName', 'validateAttributeNameDoesNotExists', 'skipOnError' => true, 'on' => 'createAttribute'), array('attributeName', 'validateAttributeDoesNotContainReservedCharacters', 'on' => 'createAttribute'));
 }