function save() { $name = $this->get_name(); $value = $this->get_value(); // Add the "lat" meta in the database $this->set_name($name . '-lat'); $this->set_value($value['lat']); $this->store->save($this); // Add the "lng" meta in the database $this->set_name($name . '-lng'); $this->set_value($value['lng']); $this->store->save($this); // Add the "zoom" meta in the database $this->set_name($name . '-zoom'); $this->set_value($value['zoom']); $this->store->save($this); // Add the "address" meta in the database $this->set_name($name . '-address'); $this->set_value($value['address']); $this->store->save($this); // Set the value for the field $this->set_name($name); $field_value = !empty($value['lat']) && !empty($value['lng']) ? $value['lat'] . ',' . $value['lng'] : ''; $this->set_value($field_value); parent::save(); }