public function read(
        $key,
        $scope = null,
        $metaData = false
    ) {
        // Assume we will have a false result
        $result = null;

        // Get scope if not passed
        if (null === $scope) {
            $scope = $this->getScope();
        }

        // Check if content exists
        if (true !== $this->exists($key, $scope)) {
            throw new Doozr_Cache_Service_Exception(
                sprintf(
                    'Requested entry with key: "%s" in scope: "%s" could not be found in cache!', $key, $scope
                )
            );
        }

        // Check that element is not expired and return ...
        if (false === $this->expired($key, $scope)) {
            // Then return the content;
            $result = $this->getContainer()->read($key, $scope);
        }

        // Return only data not meta overhead (key = 2)
        return (true === $metaData) ? $result : $result[2];
    }
public function read(
        $key,
        $scope = null,
        $metaData = false
    ) {
        // Assume we will have a false result
        $result = null;

        // Get scope if not passed
        if (null === $scope) {
            $scope = $this->getScope();
        }

        // Check if content exists
        if (true !== $this->exists($key, $scope)) {
            throw new Doozr_Cache_Service_Exception(
                sprintf(
                    'Requested entry with key: "%s" in scope: "%s" could not be found in cache!', $key, $scope
                )
            );
        }

        // Check that element is not expired and return ...
        if (false === $this->expired($key, $scope)) {
            // Then return the content;
            $result = $this->getContainer()->read($key, $scope);
        }

        // Return only data not meta overhead (key = 2)
        return (true === $metaData) ? $result : $result[2];
    }
public function read ( $ key , $ scope = null , $ metaData = false ) { // Assume we will have a false result $ result = null ; // Get scope if not passed if ( null === $ scope ) { $ scope = $ this -> getScope ( ) ; } // Check if content exists if ( true !== $ this -> exists ( $ key , $ scope ) ) { throw new Doozr_Cache_Service_Exception ( sprintf ( 'Requested entry with key: "%s" in scope: "%s" could not be found in cache!' , $ key , $ scope ) ) ; } // Check that element is not expired and return ... if ( false === $ this -> expired ( $ key , $ scope ) ) { // Then return the content; $ result = $ this -> getContainer ( ) -> read ( $ key , $ scope ) ; } // Return only data not meta overhead (key = 2) return ( true === $ metaData ) ? $ result : $ result [ 2 ] ; }
Returns the requested dataset it if exists and is not expired.

This method is intend to return the requested dataset it if exists and is not expired.

@param string $key      Key to read
@param string $scope    Scope to read from
@param bool   $metaData Whether to add meta-data

@author Benjamin Carl <opensource@clickalicious.de>

@return mixed|null Data from cache, otherwise NULL

@throws Doozr_Cache_Service_Exception
Returns the requested dataset it if exists and is not expired .