Exemple #1
0
 /**
  * Associate this driver with the provided adapter and PDO connection.
  *
  * @param Adapter $adapter
  * @param PDO $pdo
  */
 public function __construct(Adapter $adapter, PDO $pdo)
 {
     $this->adapter = $adapter;
     $this->pdo = $pdo;
     $this->adapter->setDriver($this);
 }
Exemple #2
0
 /**
  * Define the DB resource for Pimple.
  *
  * @return Wp
  */
 public function defineDb()
 {
     $this->pimple['db'] = $this->pimple->share(function () {
         global $wpdb;
         $adapter = new DbAdapter();
         $driver = new WpdbDriver($adapter, $wpdb);
         $adapter->setDriver($driver);
         return $adapter;
     });
     return $this;
 }