public function get_std_by_array($arr,$include_keys = null)
{
$tmp = new stdClass();
foreach ($arr as $key => $v){
if(empty($include_keys) || (!empty($include_keys) && in_array($key,$include_keys)))
$tmp->$key = $v;
}
return $tmp;
}
public function get_datas
{
$sql = array();
$sql[] = "SELECT * FROM wp_posts";
$this->init_pgsql();
try{
$res = ORM::raw_execute(implode(" ",$sql));
$statement = ORM::get_last_statement();
$rows = array();
$results = array();
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
$results[] = $this->get_std_by_array($row);
}
}catch (PDOException $e){
}
return empty($results) ? null : $results;
}