Пример #1
0
 public function obtenerPosterlabs()
 {
     $sql = new Sql($this->tableGateway->getAdapter());
     $select = $sql->select();
     $select->from('posterlabs');
     $statement = $sql->prepareStatementForSqlObject($select);
     $results = $statement->execute();
     $categorias = new \ArrayObject();
     foreach ($results as $row) {
         $categoria = new PosterlabsAbilitato();
         $categoria->exchangeArray($row);
         $categorias->append($categoria);
     }
     // var_dump($categorias);die;
     return $categorias;
 }
Пример #2
0
 public function listaPosizioni($id)
 {
     $sql = new Sql($this->tableGateway->getAdapter());
     $select = $sql->select();
     $select->from('posterlabs');
     $select->where(array('id' => $id));
     $statement = $sql->prepareStatementForSqlObject($select);
     $results = $statement->execute();
     $categorias = new \ArrayObject();
     foreach ($results as $row) {
         $categoria = new PosterlabsAbilitato();
         $categoria->exchangeArray($row);
         $categorias->append($categoria);
     }
     foreach ($categorias as $linea) {
         $limite = $linea->getSteps();
     }
     $endb = $this->cercaPerPosterlab($id);
     $presentes = array();
     foreach ($endb as $sqls) {
         $presentes[$sqls->getPosizione()] = $sqls->getPosizione();
     }
     $lista = array();
     for ($i = 1; $i <= $limite; $i++) {
         $lista[$i] = $i;
     }
     $result = array_diff($lista, $presentes);
     // print_r($lista);die;//var_dump($categorias);die;
     return $result;
 }