Beispiel #1
0
 /**
  * Load translations from a remote source.
  *
  * @param  string $locale
  * @param  string $textDomain
  * @return \Zend\I18n\Translator\TextDomain|null
  */
 public function load($locale, $textDomain)
 {
     $words = $this->wordsServiceFinder->findMany(['Translate' => ['Languages' => ['Locale' => $locale]]]);
     $messages[$textDomain][$locale] = [];
     if ($words->count()) {
         foreach ($words as $word) {
             $messages[$textDomain][$locale][$word->getKey()] = $word->getTranslate();
         }
     }
     $array = new PhpMemoryArray($messages);
     $result = $array->load($locale, $textDomain);
     return $result;
 }
Beispiel #2
0
 /**
  * @return ListViewModel
  */
 public function listAction(ListViewModel $view, FinderService $finder)
 {
     /** @var $pages Collection */
     $pages = $finder->findMany();
     $view->setPages($pages);
     return $view;
 }
 public function getLocationsByCityAction(Params $params, BaseFinder $cityFinderService, BaseFinder $regionFinderService, BaseFinder $countryFinderService)
 {
     $dataLocation = $params->fromPost();
     $city = $cityFinderService->find(['RoLocations' => ['Cities' => ['Id' => $dataLocation['id']]]]);
     if (!$city) {
         $this->setError('error');
         return $this->view;
     }
     $this->view->countries = $countryFinderService->findMany(['RoLocations' => ['Countries' => []]]);
     $this->view->regions = $regionFinderService->findMany(['RoLocations' => ['Regions' => ['countryId' => $city->getCountryId()]]]);
     $this->view->cities = $cityFinderService->findMany(['RoLocations' => ['Cities' => ['regionId' => $city->getRegionId()]]]);
     $this->view->locations = $city->extract();
     return $this->view;
 }
Beispiel #4
0
 private function getLanguages()
 {
     return $this->finder->findMany();
 }
Beispiel #5
0
 public function __invoke()
 {
     $this->collection = $this->finderService->findMany();
     return $this;
 }
Beispiel #6
0
 private function getLanguages()
 {
     $languages = $this->finder->findMany();
     return $languages->getValuesByAttribute('code', true);
 }