Ver Mensaje Individual
  #16 (permalink)  
Antiguo 05/02/2012, 23:35
mpiazzon
 
Fecha de Ingreso: octubre-2008
Ubicación: Mar del Plata
Mensajes: 50
Antigüedad: 15 años, 7 meses
Puntos: 1
Respuesta: Consulta objetos PHP

Si, te voy un ejemplo

Código PHP:
Ver original
  1. class ar
  2. {
  3.     public function exec($query) // retorna el array
  4.     {
  5.     }
  6.    
  7.     public function limit($param)
  8.     {
  9.          $query .= " LIMIT $param";
  10.          return $this->exec($query);
  11.     }
  12.     public function offset($param)
  13.     {
  14.          $query .= " offset $param";
  15.          return $this->exec($query);
  16.     }
  17.  
  18. }
  19.  
  20. $obj = new ar();
  21. $datos = $obj->limit(10); // todo ok
  22. $datos = $obj->offset(10); // todo ok
  23.  
  24. $datos = $obj->limit(10)->offset; // imposible
  25. $datos = $obj->offset(10)->limit; // imposible

Eso es lo que estoy intentando ver si se puede realizar.

Espero este mas claro con el ejemplo.

Nuevamente muchas gracias