public function create(
        $key,
        $value,
        $lifetime = null,
        $scope = null
    ) {
        // Get scope if not passed
        if ($scope === null) {
            $scope = $this->getScope();
        }

        // Retrieve expiration date
        if ($lifetime === null) {
            $lifetime = $this->getGcMaximumLifetime();
        }

        // Try to create entry
        if ($this->createExtended($key, $value, $lifetime, $scope) === false) {
            throw new Doozr_Cache_Service_Exception(
                sprintf('Error while creating entry with key: "%s" in scope: "%s"!', $key, $scope)
            );
        }

        return true;
    }
public function create(
        $key,
        $value,
        $lifetime = null,
        $scope = null
    ) {
        // Get scope if not passed
        if ($scope === null) {
            $scope = $this->getScope();
        }

        // Retrieve expiration date
        if ($lifetime === null) {
            $lifetime = $this->getGcMaximumLifetime();
        }

        // Try to create entry
        if ($this->createExtended($key, $value, $lifetime, $scope) === false) {
            throw new Doozr_Cache_Service_Exception(
                sprintf('Error while creating entry with key: "%s" in scope: "%s"!', $key, $scope)
            );
        }

        return true;
    }
public function create ( $ key , $ value , $ lifetime = null , $ scope = null ) { // Get scope if not passed if ( $ scope === null ) { $ scope = $ this -> getScope ( ) ; } // Retrieve expiration date if ( $ lifetime === null ) { $ lifetime = $ this -> getGcMaximumLifetime ( ) ; } // Try to create entry if ( $ this -> createExtended ( $ key , $ value , $ lifetime , $ scope ) === false ) { throw new Doozr_Cache_Service_Exception ( sprintf ( 'Error while creating entry with key: "%s" in scope: "%s"!' , $ key , $ scope ) ) ; } return true ; }
Creates an cache entry.

@param string $key      The key of the entry
@param mixed  $value    The value of the entry
@param int    $lifetime The time to expire
@param string $scope    The dataset scope

@author Benjamin Carl <opensource@clickalicious.de>

@return bool TRUE if dataset could be written, otherwise FALSE

@throws Doozr_Cache_Service_Exception
Creates an cache entry .