protected function processField($field) { switch ($field->getName()) { case 'resource': // Update the object of the relation, unless the current resource is // the object if ($this->resource->id != $this->relation->objectId) { unset($this->relation->object); } else { unset($this->relation->subject); } $value = $this->form->getValue('resource'); if (isset($value)) { $params = $this->context->routing->parse(Qubit::pathInfo($value)); if ($this->resource->id != $this->relation->objectId) { $this->relation->object = $params['_sf_route']->resource; } else { $this->relation->subject = $params['_sf_route']->resource; } } break; default: return parent::processField($field); } }
protected function processField($field) { switch ($field->getName()) { // Override RelationEditComponent case 'resource': unset($this->relation->object); $value = $this->form->getValue('resource'); if (isset($value)) { $params = $this->context->routing->parse(Qubit::pathInfo($value)); $this->relation->object = $params['_sf_route']->resource; if (null === ($this->contactInformation = $this->relation->object->getPrimaryContact())) { $this->contactInformation = new QubitContactInformation(); } } break; case 'city': case 'contactPerson': case 'countryCode': case 'email': case 'postalCode': case 'region': case 'streetAddress': case 'telephone': $this->contactInformation[$field->getName()] = $this->form->getValue($field->getName()); break; default: parent::processField($field); } }