Example #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();
 }
Example #2
0
File: model.php Project: 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);
 }
Example #4
0
 /**
  * @getter
  * @override
  * @return \MongoCollection
  */
 public function getTable()
 {
     $table = parent::getTable();
     $collection = Registry::get("MongoDB")->{$table};
     return $collection;
 }