/**
  * Validate the input arguments
  *
  * @param $field_type
  */
 protected static function validateFieldType($field_type)
 {
     if (FieldType::isValid($field_type)) {
         return;
     }
     $err_msg = self::validationErrorMsg(array('Argument 1 `$field_type` ' . 'must be a valid FieldType.'));
     throw new \InvalidArgumentException($err_msg);
 }
示例#2
0
 /**
  * Creates empty table of fields as $field_type => FieldGroup pairs
  *
  * @return array
  */
 private function initFieldTable()
 {
     $table = array();
     $field_types = FieldType::getConstants();
     foreach ($field_types as $type) {
         $field_group = new FieldGroup();
         $field_group->setRelation($this->getFieldRelation($type));
         $table[$type] = $field_group;
     }
     return $table;
 }