Ver Mensaje Individual
  #7 (permalink)  
Antiguo 22/08/2013, 09:36
lushiru
 
Fecha de Ingreso: agosto-2013
Mensajes: 57
Antigüedad: 10 años, 9 meses
Puntos: 1
Respuesta: php variable de session guarda una clase, despues como logro guardar datos

bueno resumiendo el problema:
declaro en un php index inicial la variable session = $_SESSION['venta']=new controladorventas_temp(); luego tengo definida la clase controlador en otro php seria=
class controladorventas_temp{
private $vventas_temp;
public function controladorventas_temp(){
$this->vventas_temp=array();
}
public function getvventas_temp(){
return $this->vventas_temp;
}
public function setventas_temp($newrec){
array_push($this->vventas_temp,$newrec);
}
public function getventas_temp($pos){
return $this->vventas_temp[$pos];
}
public function eliminarpos($pos){
unset($this->vventas_temp[$pos]);
$this->vventas_temp = array_values($this->vventas_temp);
}
}}
luego solo trato de setear en la variable sesion una variable = $_SESSION['venta']->setventas_temp($ven); (en los php donde uso las funciones de controlador si llama con require_once al archivo controlador)
lo cual me genera el siguiente error=
Fatal error: main(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "controladorventas_temp" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/u369062475/public_html/lucho/presentacion/aj_venta.php on line 61
ayuda plz . alguien sapbe?