public function renderItemAutocomplete($search) { if (!isset($this->localities)) { $this->localities = $this->localityFacade->findLocalities($search, self::VISIBLE_LOCALITIES); } $this->template->_form = $this['localitiesTableForm']; $this->template->localities = $this->localities; $this->template->numberOfLocalities = $this->localityFacade->getNumberOfUserLocalities(); }