Example #1
0
 /**
  * Singleton accessor
  *
  * @return Connection
  */
 public static function instance()
 {
     if (self::$instance === null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 public static function getInstance()
 {
     if (empty(self::$instance)) {
         self::$instance = new Connection();
     }
     return self::$instance;
 }
Example #3
0
File: base.php Project: brego/prank
 /**
  * The Serializable interface
  *
  * @param  string $data Serialized representation of a Model
  * @return void
  */
 public function unserialize($data)
 {
     $properties = unserialize($data);
     foreach ($properties as $property => $value) {
         $this->{$property} = $value;
     }
     $this->connection = ModelConnection::instance();
 }