public function getDefaultValidatorCollection() { $instituicoes = array_keys(App_Model_IedFinder::getInstituicoes()); $tipoBase = ComponenteCurricular_Model_TipoBase::getInstance(); $tipos = $tipoBase->getKeys(); $areas = $this->getDataMapper()->findAreaConhecimento(); $areas = CoreExt_Entity::entityFilterAttr($areas, 'id'); return array('instituicao' => new CoreExt_Validate_Choice(array('choices' => $instituicoes)), 'nome' => new CoreExt_Validate_String(array('min' => 5, 'max' => 200)), 'abreviatura' => new CoreExt_Validate_String(array('min' => 2, 'max' => 15)), 'tipo_base' => new CoreExt_Validate_Choice(array('choices' => $tipos)), 'area_conhecimento' => new CoreExt_Validate_Choice(array('choices' => $areas))); }
/** * @see clsCadastro#Gerar() */ public function Gerar() { $this->campoOculto('id', $this->getEntity()->id); // Instituição $instituicoes = App_Model_IedFinder::getInstituicoes(); $this->campoLista('instituicao', $this->_getLabel('instituicao'), $instituicoes, $this->getEntity()->instituicao); // Nome $this->campoTexto('nome', $this->_getLabel('nome'), $this->getEntity()->nome, 50, 200, TRUE, FALSE, FALSE, $this->_getHelp('nome')); // Abreviatura $this->campoTexto('abreviatura', $this->_getLabel('abreviatura'), $this->getEntity()->abreviatura, 50, 25, TRUE, FALSE, FALSE, $this->_getHelp('abreviatura')); // Tipo Base $tipoBase = ComponenteCurricular_Model_TipoBase::getInstance(); $this->campoRadio('tipo_base', $this->_getLabel('tipo_base'), $tipoBase->getEnums(), $this->getEntity()->get('tipo_base')); // Área de conhecimento $areas = $this->getDataMapper()->findAreaConhecimento(); $areas = CoreExt_Entity::entityFilterAttr($areas, 'id', 'nome'); $this->campoLista('area_conhecimento', $this->_getLabel('area_conhecimento'), $areas, $this->getEntity()->get('area_conhecimento')); }