Hello! I have created a connection $db = fDatabase(...) and I need to use $db in a class to run a complex query. I have to pass the connection as a parameter or is there another way to recognized the $db?
class Usuario extends fActiveRecord
{
protected function configure()
{
}
public function readData()
{
$data = $db->query(...);
return $data;
}
}
Should be public function readData($db) ?
Thanks!