public function save($deep = true) { // set code if (!$this->Code) { $this->Code = \HandleBehavior::getUniqueHandle($this, $this->Title, ['handleField' => 'Code']); } // call parent parent::save($deep); }
public function save($deep = true) { // set handle if (!$this->Handle) { $this->Handle = HandleBehavior::generateRandomHandle($this); } if (!$this->Expires) { $this->Expires = time() + 3600 * static::$expirationHours; } // call parent parent::save($deep); }
public function save($deep = true) { // set handle if (!$this->Handle) { $this->Handle = HandleBehavior::generateRandomHandle($this, 4); } // update PK if (!$this->ContextID && $this->Context && !$this->Context->isPhantom) { $this->ContextID = $this->Context->ID; } // call parent parent::save($deep); }
public function save($deep = true) { // set handle if (!$this->Handle) { $this->Handle = HandleBehavior::generateRandomHandle($this); } // call parent parent::save($deep); // set cookie setcookie(static::$cookieName, $this->Handle, static::$cookieExpires ? time() + static::$cookieExpires : 0, static::$cookiePath, static::$cookieDomain, static::$cookieSecure); }
public function save($deep = true) { HandleBehavior::onSave($this, $this->Title); return parent::save(true); }