MatthiasMullie\Scrapbook\KeyValueStore::set PHP Method

set() public method

Return value is a boolean true when the operation succeeds, or false on failure.
public set ( string $key, mixed $value, integer $expire ) : boolean
$key string
$value mixed
$expire integer Time when item falls out of the cache: 0 = permanent (doesn't expires); under 2592000 (30 days) = relative time, in seconds from now; over 2592000 = absolute time, unix timestamp
return boolean
    public function set($key, $value, $expire = 0);

Usage Example

コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function set($key, $value, $ttl = null)
 {
     if (!is_string($key)) {
         throw new InvalidArgumentException('Invalid key: ' . serialize($key) . '. Must be string.');
     }
     $ttl = $this->ttl($ttl);
     return $this->store->set($key, $value, $ttl);
 }
All Usage Examples Of MatthiasMullie\Scrapbook\KeyValueStore::set