Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function getFieldSet()
 {
     if ($this->locked) {
         throw new BadMethodCallException('FieldSetBuilder methods cannot be accessed anymore once the builder is turned into a FieldSet instance.');
     }
     foreach ($this->unresolvedFields as $name => $field) {
         $this->fields[$name] = $this->searchFactory->createField($name, $field['type'], $field['options']);
         unset($this->unresolvedFields[$name]);
     }
     $fieldSet = new FieldSet($this->name);
     foreach ($this->fields as $name => $field) {
         $fieldSet->set($name, $field);
     }
     $this->locked = true;
     return $fieldSet;
 }