/** * 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(); }
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); }
/** * @getter * @override * @return \MongoCollection */ public function getTable() { $table = parent::getTable(); $collection = Registry::get("MongoDB")->{$table}; return $collection; }