/** * Override this to make changes just before the model is committed to the repository during a save operation */ protected function beforeSave() { if ($this->isNewRecord()) { $this->PostedAt = new \DateTime(); } parent::beforeSave(); }
protected function beforeSave() { parent::beforeSave(); if ($this->isNewRecord()) { $this->DatePosted = new \DateTime(); } }
protected function beforeSave() { if ($this->isNewRecord()) { $this->DateCreated = "now"; } parent::beforeSave(); }
protected function beforeSave() { if ($this->isNewRecord()) { $this->DateCreated = new RhubarbDateTime("now"); } parent::beforeSave(); }
protected function beforeSave() { $this->LastUpdatedBy = new \DateTime(); if ($this->isNewRecord()) { $this->UploadedAt = new \DateTime(); } parent::beforeSave(); }
protected function beforeSave() { if ($this->isNewRecord()) { $this->CreatedAt = new DateTime('now'); $this->CreatedBy = CustomLoginProvider::getLoggedInUser()->UniqueIdentifier; } parent::beforeSave(); }