tinymvc-php
tinymvc-php copied to clipboard
PDO::FETCH_CLASS
Notice that PDO::FETCH_CLASS wasn't supported by the TinyMVC_PDO class $fetch_mode. By adding $class and $ctorargs arguments on all method using $fetch_mode. Plus side is that PDO::FETCH_INTO now works aswell
Example:
public function next($fetch_mode=null,$class=null,$ctorargs=null)
public function query($query,$params,$fetch_mode=null,$class=null,$ctorargs=null)
Inside the method:
/* get result with fetch mode */
if( $class ){
if( is_null($ctorargs) ){
$this->result->setFetchMode($fetch_mode,$class);
}else{
$this->result->setFetchMode($fetch_mode,$class,$ctorargs);
}
}else{
$this->result->setFetchMode($fetch_mode);
}