Пример #1
0
 /**
  * Close, save (if mutable), and unlock state data.
  * @throws NotOpenException If the state has already been closed.
  */
 public function close()
 {
     if ($this->updated and $this->store->isMutable()) {
         $this->store->write($this->data);
     }
     $this->store->close();
     $this->updated = false;
 }
Пример #2
0
 /**
  * Close, save (if mutable), and unlock state data.
  *
  * @throws NotOpenException If the state has already been closed.
  */
 public function close()
 {
     if (!isset($this->store)) {
         throw new NotOpenException('State already closed.');
     }
     if ($this->updated and $this->store->isMutable()) {
         $this->store->write($this->data);
     }
     $this->store->close();
     $this->store = null;
     $this->updated = false;
 }