示例#1
0
 /**
  * Every time a row is created these fields should be populated with default values.
  */
 public function save()
 {
     $primary = $this->getPrimaryColumn();
     $raw = $primary["raw"];
     if (empty($this->{$raw})) {
         $this->setCreated(date("Y-m-d H:i:s"));
     }
     $this->setModified(date("Y-m-d H:i:s"));
     parent::save();
 }
示例#2
0
文件: model.php 项目: soanni/mvc
 public function save()
 {
     $primary = $this->getPrimaryColumn();
     $raw = $primary['raw'];
     if (empty($this->{$raw})) {
         $this->setCreated(date("Y-m-d H:i:s"));
         $this->setDeleted(false);
         $this->setLive(true);
     }
     $this->setModified(date("Y-m-d H:i:s"));
     parent::save();
 }
 public function __construct()
 {
     parent::__construct($this->tablename);
 }
示例#4
0
文件: model.php 项目: vNative/vnative
 /**
  * @getter
  * @override
  * @return \MongoCollection
  */
 public function getTable()
 {
     $table = parent::getTable();
     $collection = Registry::get("MongoDB")->{$table};
     return $collection;
 }