public function indexAction() { /** * busca os saloes */ $modelSalao = new Model_DbTable_Salao(); $saloes = $modelSalao->fetchAll(null, null, 50); $this->view->saloes = $saloes; }
protected function geraSlug() { if (!$this->salao_nome) { throw new Exception("Nenhum nome de salão enviado"); } $slug = $this->corrigir($this->salao_nome); // verifica se ja existe slug $modelSalao = new Model_DbTable_Salao(); $ifExists = $modelSalao->fetchAll("salao_slug = '{$slug}'"); if ($ifExists->count() > 0) { $slug .= $ifExists->count() + 1; } return $slug; }