Example #1
0
 /**
  * Trying to re-retrieve the pdo connection after waking up
  */
 public function __wakeup()
 {
     if ($this->name) {
         $this->connection = ConnectionContainer::getConnection($this->name);
     }
 }
Example #2
0
 /**
  * Class constructor.
  *
  * @param   \PDO  $connection  The PDO connection object to help us escape string.
  *
  * @since   2.0
  */
 public function __construct(\PDO &$connection = null)
 {
     ($this->connection =& $connection) ?: ConnectionContainer::getConnection($this->name);
 }