protected function createForm()
 {
     $fields = $this->getFields();
     $existing = array();
     foreach ($this->getGroups() as $group) {
         foreach ($group['fields'] as $field) {
             $existing[$field] = true;
             if (false !== strpos($field, '.')) {
                 list($form, $name) = explode('.', $field);
                 $fields[$field]['name'] = $name;
                 $fields[$field]['form'] = $form;
             }
         }
     }
     $fields = array_intersect_key($fields, $existing);
     $typeClass = $this->class;
     $type = new $typeClass($this->getModelName(), $fields);
     return $this->factory->createForm($type, $this->getModelName(), $this->data, array('data_class' => $this->dataClass));
 }
 protected function createForm()
 {
     $type = new AdminFilterFormType($this->getModelName(), $this->getFields());
     return $this->factory->createForm($type, $this->getModelName(), $this->getCriteria());
 }