Stash\Item::save PHP Method

save() public method

public save ( )
    public function save()
    {
        try {
            return $this->executeSet($this->data, $this->expiration);
        } catch (Exception $e) {
            $this->logException('Setting value in cache caused exception.', $e);
            $this->disable();
            return false;
        }
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function save()
 {
     $dataBackup = $this->data;
     $this->data = [static::DATA_FIELD => $dataBackup, static::TAGS_FIELD => iterator_to_array($this->getVersionedTags($this->tags))];
     $result = parent::save();
     $this->data = $dataBackup;
     return $result;
 }