public function toEntity($data, $type) { if ('photon' == $type) { $data = $this->normalizePhotonData($data); } if (empty($data)) { return new Location(); } $entity = new Location(); $entity->setCity($data['city'])->setRegion($data['region'])->setPostalcode($data['postalcode'])->setCountry($data['country']); if (!empty($data['coordinates'])) { $entity->setCoordinates(new Point($data['coordinates'])); } return $entity; }
/** * @testdox Allows setting and getting the email address */ public function testSettingAndGettingTheCoordinates() { $coordinates = new Point([50, 8]); $this->target->setCoordinates($coordinates); $this->assertEquals($coordinates, $this->target->getCoordinates()); }