Stash\Item::get PHP Method

get() public method

public get ( )
    public function get()
    {
        try {
            if (!isset($this->data)) {
                $this->data = $this->executeGet($this->invalidationMethod, $this->invalidationArg1, $this->invalidationArg2);
            }
            if (false === $this->isHit) {
                return null;
            }
            return $this->data;
        } catch (Exception $e) {
            $this->logException('Retrieving from cache caused exception.', $e);
            $this->disable();
            return null;
        }
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function get()
 {
     parent::get();
     if (is_array($this->data) && array_key_exists(static::DATA_FIELD, $this->data) && array_key_exists(static::TAGS_FIELD, $this->data)) {
         $this->tags = array_keys($this->data[static::TAGS_FIELD]);
         $this->data = $this->data[static::DATA_FIELD];
     }
     return $this->data;
 }
All Usage Examples Of Stash\Item::get