Example #1
0
 /**
  * @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.');
     }
 }
Example #2
0
 /**
  * @param Driver $driver
  */
 public function __construct(Driver $driver)
 {
     parent::__construct();
     $this->driver = $driver;
 }