I try to implement something like:
$data = my_obj::get_rows();
$data
is now a PDO Statement,
my_obj
is my class ( i have one for every db table ), implements __set and __get magic
get_rows()
is a static method that return a PDO Statement.
Now i want convert $data to an my_obj
instance, so I can have access to class method, something like :
while( $d = my_obj::inject( $data ) ){
$d->my_method();
}
Now, i try to write my ::inject
static method:
static function inject($pdo_statement) {
$data = $pdo_statement->fetchAll(PDO::FETCH_ASSOC);
//and now?
}
Can anyone help to solve this method?