<?
class Flip
{
private $db;
public function __construct()
{
$this->db = new Database();
}
public function flips()
{
$flips = array();
$result = $this->db->Select()->Get('flips');
if($result)
{
foreach ($result as $value)
{
$flips[] = $value;
}
return $flips;
}
return false;
}
public function flipComment($id)
{
return $this->db->Select()->Where('id', $id)->Get('comments');
}
}
Fatal error: Using
$thiswhen not in object context.
Any ideas how to fix? I don't want to recall class Database for each function. I need to be able to use $this->db