저자: Woody Gilk
예제 #1
0
 /**
  * Overload the update method to auto-insert
  * the timestamp for modified if not exist
  *
  * @return void
  * @author Sam de Freyssinet
  */
 public function update()
 {
     if (!isset($this->_fields['modified'])) {
         return parent::update();
     }
     if ($this->modified === NULL) {
         $this->modified = time();
     }
     return parent::update();
 }
예제 #2
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();
 }