public function __toString()
 {
     return sprintf('#%d %s', $this->weight, $this->field->getType());
 }
 /**
  * @return array
  */
 protected function getRenderedFormOptions()
 {
     $choices = array();
     foreach ($this->choices as $key => $row) {
         if (!is_array($row)) {
             $row = array('value' => $row);
         }
         if (array_key_exists('key', $row) && $row['key'] !== null) {
             $key = $row['key'];
         }
         if (array_key_exists('optgroup', $row) && $row['optgroup'] !== null) {
             $choices[$row['optgroup']][$key] = $row['value'];
         } else {
             $choices[$key] = $row['value'];
         }
     }
     return array_replace_recursive(parent::getRenderedFormOptions(), array('choices' => $choices, 'expanded' => $this->expanded, 'multiple' => $this->multiple));
 }
 /**
  * @return array
  */
 protected function getRenderedFormOptions()
 {
     return array_replace_recursive(parent::getRenderedFormOptions(), array('options' => array('fields' => $this->fields->toArray())));
 }