Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public function getAutocomplateList($txt, $type){
  2. $respons = [];
  3. if($type == 2){
  4. $service = $this->getServiceLocator()->get('location_service');
  5. $respons = $service->getLocationByTxt($txt);
  6. } elseif($type == 3){
  7. $dao = new \DDD\Dao\Accommodation\Accommodations($this->getServiceLocator(), 'DDD\Domain\Accommodation\TranslationAutocomplete');
  8. $result = $dao->getAccommodationsForTranlation($txt);
  9. foreach ($result as $row){
  10. $respons[] = ['id' => $row->getId(),'name' => $row->getName()];
  11. }
  12. }
  13. return $respons;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement