/** * @param MetaModel $meta * * @return Ajde_Crud_Options_Fields_Field */ protected function decorationFactory(MetaModel $meta) { $field = new Ajde_Crud_Options_Fields_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; }
protected function addField(Ajde_Crud_Options_Fields_Field $field) { $this->_fields[$field->getName()] = $field; }