/** * @param POIKeyword $poiKeyword * @return VehicleCategoryListDTO */ public function toPoiKeywordListDTO(POIKeyword $poiKeyword) { $poiKeywordListDTO = new VehicleCategoryListDTO(); $poiKeywordListDTO->id = $poiKeyword->getId(); $poiKeywordListDTO->name = $poiKeyword->getName(); return $poiKeywordListDTO; }
/** * @param $name * @param null $memo * @return POIKeyword */ public static function registerPOIKeyword($name, $memo = null) { $poiKeyword = new POIKeyword(); $poiKeyword->setName($name); $poiKeyword->setMemo($memo); return $poiKeyword; }
public function testPoiCRUD() { $address = Address::registerAddress('Grundstrasse 12', '6431', 'Schwyz', 'Schweiz', 'Spital Schwyz', 47.17546, 8.517752, 'Spital'); $this->init->addressRepo->store($address); $poiKeyword1 = POIKeyword::registerPOIKeyword('Tet1234'); $poiKeyword2 = POIKeyword::registerPOIKeyword('Test2345'); $poiKeyword3 = POIKeyword::registerPOIKeyword('Test3456'); $this->init->poiKeywordRepo->store($poiKeyword1); $this->init->poiKeywordRepo->store($poiKeyword2); $this->init->poiKeywordRepo->store($poiKeyword3); $poi = POI::registerPoi('Krankenhaus', $address, 'Therapie', '041 818 21 21'); $poi->assignKeyword($poiKeyword1); $poi->assignKeyword($poiKeyword2); $poi->assignKeyword($poiKeyword3); $this->init->poiRepo->store($poi); $this->init->em->flush(); $poiFind = $this->init->poiRepo->find($poi->getId()); $this->assertEquals($poi, $poiFind); $poi->updatePOIData('Altersheim Wohnwohl', null, 'Pflege', '041 818 31 31', 'Gutes Heim'); $this->init->poiRepo->store($poi); $this->init->em->flush(); $poiFind = $this->init->poiRepo->find($poi->getId()); $this->assertEquals($poi, $poiFind); $this->poiRemove($poi); }