예제 #1
0
파일: Type.php 프로젝트: nabble/ajde-core
 /**
  * 
  * @param MetaModel $meta
  * @return Ajde_Crud_Options_Fields_Field
  */
 protected function decorationFactory(MetaModel $meta)
 {
     $field = new Field();
     $field->setName('meta_' . $meta->getPK());
     $field->setType('text');
     $field->setLabel($meta->get('name'));
     if ($meta->getOption('help')) {
         $field->setHelp($meta->getOption('help'));
     }
     if ($meta->getOption('default')) {
         $field->setDefault($meta->getOption('default'));
     }
     if ($meta->getOption('readonly')) {
         $field->setIsReadonly(true);
     }
     $field->setLength($meta->getIntOption('length'));
     $field->setIsRequired($meta->getBooleanOption('required'));
     return $field;
 }
예제 #2
0
 protected function addField(Field $field)
 {
     $this->_fields[$field->getName()] = $field;
 }