/** * Take the latitude/longitude fields and save them to the DataObject. * {@inheritdoc} */ public function saveInto(DataObjectInterface $record) { $record->setCastedField($this->childFieldName('Latitude'), $this->latField->dataValue()); $record->setCastedField($this->childFieldName('Longitude'), $this->lngField->dataValue()); $record->setCastedField($this->childFieldName('Zoom'), $this->zoomField->dataValue()); return $this; }
/** * @param array $arr */ public function setAllowedCurrencies($arr) { $this->allowedCurrencies = $arr; // @todo Has to be done twice in case allowed currencies changed since construction $oldVal = $this->fieldCurrency->dataValue(); $this->fieldCurrency = $this->FieldCurrency($this->name); $this->fieldCurrency->setValue($oldVal); return $this; }
/** * Called before the dataobject record is saved. * @param DataObjectInterface $record The record. * @return [type] [description] */ public function saveInto(DataObjectInterface $record) { // On the dataobject record set the lat, long, zoom fields (names specified by the dev at // time of construction) to the values of the lat long and zoom child fields of this class. $record->setCastedField($this->latFieldName, $this->latField->dataValue()); $record->setCastedField($this->lngFieldName, $this->lngField->dataValue()); $record->setCastedField($this->zoomFieldName, $this->zoomField->dataValue()); // Do parent stuff as normal. return parent::saveInto($record); }
/** * {@inheritdoc} */ public function saveInto(DataObjectInterface $record) { if ($this->name) { $record->setCastedField($this->name, $this->geometryField->dataValue()); } }