__construct() protected méthode

Initialize the fields and add validation rules based on field properties.
protected __construct ( ) : void
Résultat void
Exemple #1
0
 protected function __construct()
 {
     // Set the $_db to the static $_usedb
     // The static $_usedb thus determines which db future Sprig instances will have
     // Example: Sprig_Wi3::$_usedb = Database::instance("name", $config); $obj = Sprig_Wi3::factory(""); ... more Sprig_Wi3 models
     if (!empty(self::$_usedb)) {
         $this->_db = self::$_usedb;
     }
     // Now construct the Sprig
     return parent::__construct();
 }