Exemplo n.º 1
0
 public function existe()
 {
     $categoria = $this->atributos['slug'];
     $datos = JaCategoriasQuery::create()->filterByTitulo($categoria)->findOne();
     $helper = new Helper();
     $resultado = array('existe' => false);
     if ($helper->contieneDatos($datos->toArray())) {
         $resultado = array('existe' => true, 'id' => $datos->getId(), 'titulo' => $datos->getTitulo());
     }
     return $resultado;
 }
Exemplo n.º 2
0
 public function existeCategoria()
 {
     $this->where = $this->atributos;
     $datos = $this->unico(self::$modelo);
     $helper = new Helper();
     $resultado = array('existe' => false);
     if ($helper->contieneDatos($datos)) {
         $resultado = array('existe' => true, 'id' => $datos['id'], 'titulo' => $datos['titulo']);
     }
     return $resultado;
 }