src/Lazy.php
public function save($id, $data, $lifeTime = 0)
    {
        $id = $this->getCompletedCacheIdIfValid($id);

        if (is_object($data)) {
            throw new \InvalidArgumentException('You cannot use this cache to cache an object, only arrays, strings and numbers. Have a look at Transient cache.');
            // for performance reasons we do currently not recursively search whether any array contains an object.
        }

        return $this->backend->doSave($id, $data, $lifeTime);
    }
public function save($id, $data, $lifeTime = 0)
    {
        $id = $this->getCompletedCacheIdIfValid($id);

        if (is_object($data)) {
            throw new \InvalidArgumentException('You cannot use this cache to cache an object, only arrays, strings and numbers. Have a look at Transient cache.');
            // for performance reasons we do currently not recursively search whether any array contains an object.
        }

        return $this->backend->doSave($id, $data, $lifeTime);
    }
Puts data into the cache.

@param string $id       The cache id.
@param mixed  $data     The cache entry/data.
@param int    $lifeTime The cache lifetime in seconds.
If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime).

@return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise.