/** * @param mixed $db Db or Pdo */ public function __construct($db) { parent::__construct(); if ($db instanceof PDO) { $this->db = new Db($db); } elseif ($db instanceof Db) { $this->db = $db; } else { throw new InvalidArgumentException('$db must be an instance of Respect\\Relational\\Db or PDO.'); } }
/** * @param Driver $driver */ public function __construct(Driver $driver) { parent::__construct(); $this->driver = $driver; }