public function get($key, $default = null)
	{
		// check if we have this key
		if (parent::has($this->prefixKey($key)))
		{
			// do we have expiry information?
			if ( ! isset($this->data[static::EXPIRE_DATA_KEY][$key]))
			{
				// nope, simply return the data
				return parent::get($this->prefixKey($key), $default);
			}

			// return the data if we don't have expiry information or if the data is valid
			if ($this->data[static::EXPIRE_DATA_KEY][$key][1] !== static::EXPIRE_STATE_EXPIRED)
			{
				// check the expiry strategy
				if ($this->data[static::EXPIRE_DATA_KEY][$key][0] === EXPIRE_ON_GET)
				{
					// expire on get, so expire it
					$this->data[static::EXPIRE_DATA_KEY][$key][1] = static::EXPIRE_STATE_EXPIRED;
				}

				// return the data
				return parent::get($this->prefixKey($key), $default);
			}
		}

		// no dice, return the default
		return $default;
	}
public function get($key, $default = null)
	{
		// check if we have this key
		if (parent::has($this->prefixKey($key)))
		{
			// do we have expiry information?
			if ( ! isset($this->data[static::EXPIRE_DATA_KEY][$key]))
			{
				// nope, simply return the data
				return parent::get($this->prefixKey($key), $default);
			}

			// return the data if we don't have expiry information or if the data is valid
			if ($this->data[static::EXPIRE_DATA_KEY][$key][1] !== static::EXPIRE_STATE_EXPIRED)
			{
				// check the expiry strategy
				if ($this->data[static::EXPIRE_DATA_KEY][$key][0] === EXPIRE_ON_GET)
				{
					// expire on get, so expire it
					$this->data[static::EXPIRE_DATA_KEY][$key][1] = static::EXPIRE_STATE_EXPIRED;
				}

				// return the data
				return parent::get($this->prefixKey($key), $default);
			}
		}

		// no dice, return the default
		return $default;
	}
public function get ( $ key , $ default = null ) { // check if we have this key if ( parent :: has ( $ this -> prefixKey ( $ key ) ) ) { // do we have expiry information? if ( ! isset ( $ this -> data [ static :: EXPIRE_DATA_KEY ] [ $ key ] ) ) { // nope, simply return the data return parent :: get ( $ this -> prefixKey ( $ key ) , $ default ) ; } // return the data if we don't have expiry information or if the data is valid if ( $ this -> data [ static :: EXPIRE_DATA_KEY ] [ $ key ] [ 1 ] !== static :: EXPIRE_STATE_EXPIRED ) { // check the expiry strategy if ( $ this -> data [ static :: EXPIRE_DATA_KEY ] [ $ key ] [ 0 ] === EXPIRE_ON_GET ) { // expire on get, so expire it $ this -> data [ static :: EXPIRE_DATA_KEY ] [ $ key ] [ 1 ] = static :: EXPIRE_STATE_EXPIRED ; } // return the data return parent :: get ( $ this -> prefixKey ( $ key ) , $ default ) ; } } // no dice, return the default return $ default ; }
Returns a key's value from this bag's data

@param string $key
@param mixed  $default

@return mixed
Returns a key s value from this bag s data