public function onBeforeSave() { parent::onBeforeSave(); if (!$this->ID) { $this->AuthorID = Member::currentUserID(); } }
public function onBeforeSave() { if (!$this->isInDB()) { //TO DO - this does not seem to work $this->AuthorID = Member::currentUser()->ID; } parent::onBeforeSave(); }