/** * @return void * @desc Re-build from data posted by this control the data object this control is editing */ function BuildPostedDataObject() { $this->o_data_object = new PostalAddress(); $this->o_data_object->SetSaon($_POST['saon']); $this->o_data_object->SetPaon($_POST['paon']); $this->o_data_object->SetStreetDescriptor($_POST['streetDescriptor']); $this->o_data_object->SetLocality($_POST['locality']); $this->o_data_object->SetTown($_POST['town']); $this->o_data_object->SetAdministrativeArea($_POST['county']); $this->o_data_object->SetPostcode($_POST['postcode']); $this->o_data_object->SetGeoLocation(isset($_POST['lat']) ? $_POST['lat'] : null, isset($_POST['long']) ? $_POST['long'] : null, isset($_POST['geoprecision']) ? $_POST['geoprecision'] : null); }
/** * @return void * @desc Re-build from data posted by this control the data object this control is editing */ public function BuildPostedDataObject() { $school = new School($this->GetSettings()); if (isset($_POST['item'])) { $school->SetId($_POST['item']); } $school->SetName($_POST['school-name'] . ", " . $_POST["town"]); $school->Ground()->SetId($_POST['ground-id']); $address = new PostalAddress(); $address->SetPaon($_POST['school-name']); $address->SetStreetDescriptor($_POST['street']); $address->SetLocality($_POST['locality']); $address->SetTown($_POST['town']); $address->SetAdministrativeArea($_POST['county']); $address->SetPostcode($_POST['postcode']); $address->SetGeoLocation($_POST['latitude'], $_POST['longitude'], $_POST['geoprecision']); $school->Ground()->SetAddress($address); $this->SetDataObject($school); }