/**
  * Saves a bind in the database
  *
  * @return void
  */
 public function saveObject()
 {
     $dao = new Tracker_FormElement_Field_List_Bind_StaticDao();
     if ($dao->save($this->field->getId(), $this->is_rank_alpha)) {
         $value_dao = $this->getValueDao();
         foreach ($this->getAllValues() as $v) {
             if ($id = $value_dao->create($this->field->getId(), $v->getLabel(), $v->getDescription(), 'end', $v->isHidden())) {
                 $v->setId($id);
             }
         }
     }
     parent::saveObject();
 }
 /**
  * Create a bind for the field
  *
  * @param Field $field     the field
  * @param string $type     the type of bind. If empty, STATIK
  * @param array $bind_data the data used to create the bind
  *
  * @return Bind null if error
  */
 public function createBind($field, $type, $bind_data)
 {
     $bind = null;
     switch ($type) {
         case '':
             //default is static
         //default is static
         case self::STATIK:
             $dao = new Tracker_FormElement_Field_List_Bind_StaticDao();
             if ($dao->save($field->getId(), 0)) {
                 $bind = new Tracker_FormElement_Field_List_Bind_Static($field, 0, array(), array(), array());
                 $bind->process($bind_data, 'no redirect');
             }
             break;
         case self::USERS:
             $dao = new Tracker_FormElement_Field_List_Bind_UsersDao();
             if ($dao->save($field->getId(), array())) {
                 $bind = new Tracker_FormElement_Field_List_Bind_Users($field, '', array(), array());
                 $bind->process($bind_data, 'no redirect');
             }
             break;
         case self::UGROUPS:
             $bind = new Tracker_FormElement_Field_List_Bind_Ugroups($field, array(), array(), array(), $this->ugroup_manager, $this->getUgroupsValueDao());
             $bind->process($bind_data, 'no redirect');
             break;
         default:
             break;
     }
     return $bind;
 }