Exemplo n.º 1
0
 public function save($deep = true)
 {
     // set code
     if (!$this->Code) {
         $this->Code = \HandleBehavior::getUniqueHandle($this, $this->Title, ['handleField' => 'Code']);
     }
     // call parent
     parent::save($deep);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 public function save($deep = true)
 {
     HandleBehavior::onSave($this, $this->Title);
     return parent::save(true);
 }