src/Charcoal/Cache/Facade/CachePoolFacade.php
protected function save(CacheItemInterface $item, $value, $ttl = null)
    {
        if ($ttl === null) {
            $ttl = $this->defaultTtl();
        }

        if (is_numeric($ttl) || ($ttl instanceof \DateInterval)) {
            $item->expiresAfter($ttl);
        } elseif ($ttl instanceof \DateTimeInterface) {
            $item->expiresAt($ttl);
        }

        $item->set($value);

        return $this->cachePool()->save($item);
    }
protected function save(CacheItemInterface $item, $value, $ttl = null)
    {
        if ($ttl === null) {
            $ttl = $this->defaultTtl();
        }

        if (is_numeric($ttl) || ($ttl instanceof \DateInterval)) {
            $item->expiresAfter($ttl);
        } elseif ($ttl instanceof \DateTimeInterface) {
            $item->expiresAt($ttl);
        }

        $item->set($value);

        return $this->cachePool()->save($item);
    }
protected function save ( CacheItemInterface $ item , $ value , $ ttl = null ) { if ( $ ttl === null ) { $ ttl = $ this -> defaultTtl ( ) ; } if ( is_numeric ( $ ttl ) || ( $ ttl instanceof \ DateInterval ) ) { $ item -> expiresAfter ( $ ttl ) ; } elseif ( $ ttl instanceof \ DateTimeInterface ) { $ item -> expiresAt ( $ ttl ) ; } $ item -> set ( $ value ) ; return $ this -> cachePool ( ) -> save ( $ item ) ; }
Set a value on a cache item to be saved immediately.

@param  CacheItemInterface $item  The cache item to save.
@param  mixed              $value The serializable value to be stored.
@param  mixed              $ttl   An integer, interval, date, or NULL to use the facade's default value.
@return boolean TRUE if the item was successfully persisted. FALSE if there was an error.
Set a value on a cache item to be saved immediately .