__construct() protected method

Initialize the fields and add validation rules based on field properties.
protected __construct ( ) : void
return void
コード例 #1
0
ファイル: sprig.php プロジェクト: azuya/Wi3
 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();
 }