Exemplo n.º 1
0
 private function poiRemove(POI $poi)
 {
     $id = $poi->getId();
     POI::removePoi($poi);
     $this->init->em->remove($poi);
     $this->init->em->flush();
     $this->assertEquals(null, $this->init->poiRepo->find($id));
 }
 /**
  * @return mixed|void
  */
 public function createFormRows()
 {
     $dto = $this->dto;
     $this->basicFormRows[] = new FormRowView('id', 'poi.field.id', $dto->id);
     $this->basicFormRows[] = new FormRowView('name', 'poi.field.name', $dto->name);
     $this->basicFormRows[] = new FormRowView('department', 'poi.field.department', $dto->department);
     $this->basicFormRows[] = new FormRowView('telephone', 'poi.field.telephone', $dto->telephone);
     $this->basicFormRows[] = new FormRowView('address', 'address.field.lookahead', $dto->address->addressDisplayName);
     $this->basicFormRows[] = new FormRowView('keywords', 'poi.field.keywords', POI::constructKeywordsString($dto->keywords));
     $this->expandedFormRows[] = new FormRowView('comment', 'poi.field.comment', $dto->comment);
     $this->expandedFormRows[] = new FormRowView('details', 'poi.field.details', $dto->details);
 }
Exemplo n.º 3
0
 /**
  * @param POI $poi
  * @return POIListDTO
  */
 public function poiToPOIListDTO(POI $poi)
 {
     $poiListDTO = new POIListDTO();
     $poiListDTO->id = $poi->getId();
     $poiListDTO->isActive = $poi->getIsActive();
     $poiListDTO->name = $poi->getName();
     $poiListDTO->department = $poi->getDepartment();
     $poiListDTO->telephone = $poi->getTelephone();
     $poiListDTO->street = $poi->getAddress()->getStreet();
     $poiListDTO->city = $poi->getAddress()->getCity();
     $poiListDTO->keywords = $poi->getKeywordsAsString();
     return $poiListDTO;
 }
Exemplo n.º 4
0
 /**
  * @param POI $poi
  */
 public function assignPoi(POI $poi)
 {
     $poi->setAddress($this);
     $this->pois->add($poi);
 }
Exemplo n.º 5
0
 /**
  * @param $name
  * @param $department
  * @param Address $address
  * @param null $telephone
  * @param null $comment
  * @param null $details
  * @return POI
  */
 public static function registerPoi($name, Address $address, $department = null, $telephone = null, $comment = null, $details = null)
 {
     $poi = new POI();
     if (!empty($name)) {
         $poi->setName($name);
     }
     if (!empty($address)) {
         $poi->assignAddress($address);
     }
     $poi->setDepartment($department);
     $poi->setTelephone($telephone);
     $poi->setComment($comment);
     $poi->setDetails($details);
     $poi->activate();
     return $poi;
 }