public function __construct(PDO $pdo = null) { if ($pdo) { $this->db = $pdo; } else { if (!Registry::has('main')) { throw new \Exception('Connection is not set up'); } $this->db = Registry::get('main'); } }
public function __construct() { parent::__construct(\Hub\Registry::get('db_session')); }