Retrieve all cached data

@param boolean [optional] $meta
@return array | null
161607
public function retrieveAll($raw = false)
    {
        if ($cache = $this->loadCache()) {
            if (!$raw) {
                $results = [];
                foreach ($cache as $key => $value) {
                    $results[$key] = unserialize($value['data']);
                }
                return $results;
            } else {
                return $cache;
            }
        }
        return null;
    }
330830
public function getMetaData($key)
    {
        if (!isset($this->metaData[$key])) {
            return false;
        }
        
        return $this->metaData[$key];
    }
574298
protected function getMetaDoc($meta)
    {
        if ($meta instanceof \Couchbase\Document) {
            return $meta->value;
        }
        if (is_array($meta)) {
            $result = [];
            foreach ($meta as $row) {
                $result[] = $this->getMetaDoc($row);
            }

            return $result;
        }

        return null;
    }
256096
public function getAllMetadata()
    {
        if (!$this->metadataLoaded) {
            // We have to load all the metadata
            $doctrineMetadata = $this->doctrine->getManager()->getMetadataFactory();

            /** @var ClassMetadata $doctrineClassMetadata */
            foreach ($doctrineMetadata->getAllMetadata() as $doctrineClassMetadata) {
                $reflectionClass = $doctrineClassMetadata->getReflectionClass();
                $this->metadata[$reflectionClass->getName()] = $this->getClassMetadata($reflectionClass);
            }

            $this->metadataLoaded = true;
        }

        $allMetadata = array_filter($this->metadata, function($element) { return null !== $element; });

        return $allMetadata;
    }
1039255
protected function getData($key)
    {
        $cacheKey = $this->key($key);
        return array_key_exists($cacheKey, $this->cache)?$this->cache[$this->key($key)]:false;
    }
233038
public function get($key)
    {
        $data = [];
        $data = $this->memcached()->get($key);

        return ($this->memcached()->getResultCode() == 0) ? $data : null;
    }
267728
public function getMetadatum($name)
        {
            if (array_key_exists($name, $this->metadata)) {
                return $this->metadata[$name];
            }
            return null;
        }
598715
private function loadCacheMetaData()
    {
        if (isset($this->metaData)) {
            return;
        }

        $metaFile = $this->cacheDirectory . '/cache.meta';
        $this->metaData = array();

        if (file_exists($metaFile)) {
            $this->metaData = unserialize(file_get_contents($metaFile));
        }
    }
1112547
public function getMetaDataValue($key) {

            return (isset($this->meta[$key]) ? $this->meta[$key] : null);

        }
685862
public function getMeta($key = null, $default = null)
    {
        if ($key === null) {
            return $this->meta;
        }

        return isset($this->meta[$key]) ? $this->meta[$key] : $default;
    }
785081
private function loadSearchMetadata(EntityMetadata $metadata)
    {
        if (false === $metadata->isSearchEnabled()) {
            return $metadata;
        }
        $clientKey = $metadata->search->getKey();
        $searchFactory = $this->driver->getSearchMetadataFactory($clientKey);

        $searchFactory->handleLoad($metadata);
        $searchFactory->handleValidate($metadata);
        return $metadata;
    }
364946
public function getPkValue(Meta $meta = null)
    {
        if (null === $meta) {
            $meta = $this->getMeta();
        }

        return $this->{$meta->primaryKey->getAttrName()};
    }
1309815
public static function fromMetadata(string $metadata): ? array
    {
        $values = [];
        $splittedParts = explode('~~', $metadata);

        foreach ($splittedParts as $part) {
            $parts = explode('##', $part);
            if (count($parts) > 1) {
                $values[$parts[0]] = $parts[1];
            } else {
                $values[] = $part;
            }
        }

        if (1 == count($values)) {
            $firstAndUniqueElement = reset($values);
            $values = [
                'id' => $firstAndUniqueElement,
                'name' => $firstAndUniqueElement,
            ];
        }

        if (!array_key_exists('id', $values)) {
            return null;
        }

        return $values;
    }
273708
public function getMetadata($source)
    {
        $context = $this->_context;

        if ($context->connection) {
            $type = null;
            $connection = $context->connection;
        } else {
            $type = $this->_has_slave ? 'slave' : 'default';
            $connection = $this->poolManager->pop($this, $this->_timeout, $type);
        }

        try {
            $start_time = microtime(true);
            $meta = $connection->getMetadata($source);
            $elapsed = round(microtime(true) - $start_time, 3);
        } finally {
            if ($type) {
                $this->poolManager->push($this, $connection, $type);
            }
        }

        $this->logger->debug(compact('elapsed', 'source', 'meta'), 'db.metadata');

        return $meta;
    }
1350649
protected function encodeMetaToArray($meta): array
    {
        $this->withMeta($meta);

        $writer = $this->getFactory()->createDocumentWriter();

        $writer->setUrlPrefix($this->getUrlPrefix());

        // write header
        $this->writeHeader($writer);

        // write footer
        $this->writeFooter($writer);

        // encode to json
        $array = $writer->getDocument();

        return $array;
    }
1356755
public function meta($key = null)
    {
        if ($key !== null) {
            return array_get($this->meta, $key);
        }

        return $this->meta;
    }
80715
public function getMetadata(): Data
    {
        if ($this->_metadata === null) {
            $this->_metadata = new Data();

            $this->setMetadata([]);
        }

        return $this->_metadata;
    }