protected function addField($name)
 {
     switch ($name) {
         case 'alternateTitle':
         case 'edition':
             $this->form->setDefault($name, $this->resource[$name]);
             $this->form->setValidator($name, new sfValidatorString());
             $this->form->setWidget($name, new sfWidgetFormInput());
             break;
         case 'editionStatementOfResponsibility':
         case 'issuingJurisdictionAndDenomination':
         case 'noteOnPublishersSeries':
         case 'numberingWithinPublishersSeries':
         case 'otherTitleInformation':
         case 'otherTitleInformationOfPublishersSeries':
         case 'parallelTitleOfPublishersSeries':
         case 'standardNumber':
         case 'statementOfCoordinates':
         case 'statementOfProjection':
         case 'statementOfResponsibilityRelatingToPublishersSeries':
         case 'statementOfScaleArchitectural':
         case 'statementOfScaleCartographic':
         case 'titleStatementOfResponsibility':
         case 'titleProperOfPublishersSeries':
             $this->form->setDefault($name, $this->rad[$name]);
             $this->form->setValidator($name, new sfValidatorString());
             $this->form->setWidget($name, new sfWidgetFormInput());
             break;
         case 'type':
             $criteria = new Criteria();
             $this->resource->addObjectTermRelationsRelatedByObjectIdCriteria($criteria);
             QubitObjectTermRelation::addJoinTermCriteria($criteria);
             $criteria->add(QubitTerm::TAXONOMY_ID, QubitTaxonomy::MATERIAL_TYPE_ID);
             $value = array();
             foreach ($this->relations = QubitObjectTermRelation::get($criteria) as $item) {
                 $value[] = $this->context->routing->generate(null, array($item->term, 'module' => 'term'));
             }
             $this->form->setDefault('type', $value);
             $this->form->setValidator('type', new sfValidatorPass());
             $choices = array();
             foreach (QubitTaxonomy::getTermsById(QubitTaxonomy::MATERIAL_TYPE_ID) as $item) {
                 $choices[$this->context->routing->generate(null, array($item, 'module' => 'term'))] = $item;
             }
             $this->form->setWidget('type', new sfWidgetFormSelect(array('choices' => $choices, 'multiple' => true)));
             break;
         default:
             return parent::addField($name);
     }
 }
 protected function addField($name)
 {
     switch ($name) {
         case 'type':
             $criteria = new Criteria();
             $this->resource->addObjectTermRelationsRelatedByObjectIdCriteria($criteria);
             QubitObjectTermRelation::addJoinTermCriteria($criteria);
             $criteria->add(QubitTerm::TAXONOMY_ID, QubitTaxonomy::MODS_RESOURCE_TYPE_ID);
             $value = array();
             foreach ($this->relations = QubitObjectTermRelation::get($criteria) as $item) {
                 $value[] = $this->context->routing->generate(null, array($item->term, 'module' => 'term'));
             }
             $this->form->setDefault('type', $value);
             $this->form->setValidator('type', new sfValidatorPass());
             $choices = array();
             foreach (QubitTaxonomy::getTermsById(QubitTaxonomy::MODS_RESOURCE_TYPE_ID) as $item) {
                 $choices[$this->context->routing->generate(null, array($item, 'module' => 'term'))] = $item;
             }
             $this->form->setWidget('type', new sfWidgetFormSelect(array('choices' => $choices, 'multiple' => true)));
             break;
         default:
             return parent::addField($name);
     }
 }