protected function addField($name)
 {
     switch ($name) {
         case 'location':
         case 'name':
             $this->form->setDefault($name, $this->resource[$name]);
             $this->form->setValidator($name, new sfValidatorString());
             $this->form->setWidget($name, new sfWidgetFormInput());
             break;
         case 'type':
             $this->form->setDefault('type', $this->context->routing->generate(null, array($this->resource->type, 'module' => 'term')));
             $this->form->setValidator('type', new sfValidatorString());
             $this->form->setWidget('type', new sfWidgetFormSelect(array('choices' => QubitTerm::getIndentedChildTree(QubitTerm::CONTAINER_ID, ' ', array('returnObjectInstances' => true)))));
             break;
         default:
             return parent::addField($name);
     }
 }
 protected function addField($name)
 {
     switch ($name) {
         case 'containers':
             $this->form->setValidator('containers', new sfValidatorPass());
             $this->form->setWidget('containers', new sfWidgetFormSelect(array('choices' => array(), 'multiple' => true)));
             break;
         case 'location':
         case 'name':
             $this->form->setValidator($name, new sfValidatorString());
             $this->form->setWidget($name, new sfWidgetFormInput());
             break;
         case 'type':
             $this->form->setValidator('type', new sfValidatorString());
             $this->form->setWidget('type', new sfWidgetFormSelect(array('choices' => QubitTerm::getIndentedChildTree(QubitTerm::CONTAINER_ID, ' ', array('returnObjectInstances' => true)))));
             break;
         default:
             return parent::addField($name);
     }
 }