Get data from entity for cache set

@return mixed
764545
public function getDataForCache()
    {
        $reflectionClass = new \ReflectionObject($this);
        $array = array();
        $excludes = array_flip($this->excludedPropertiesForCache);
        $excludes['excludedPropertiesForCache'] = true;
        foreach ($reflectionClass->getProperties() as $property) {
            $propertyName = $property->getName();
            if (!isset($excludes[$propertyName])
                && null !== $value = $this->processPropertyForCache($propertyName)) {
                $array[$propertyName] = $value;
            }
        }

        return $this->encodeDataForCache($array);
    }
1039255
protected function getData($key)
    {
        $cacheKey = $this->key($key);
        return array_key_exists($cacheKey, $this->cache)?$this->cache[$this->key($key)]:false;
    }
559341
public function getItems()
    {
        if (!$this->itemsChanged && $this->cacheItems && count($this->cacheItems) === count($this->entity->getItems())) {
            return $this->cacheItems;
        } else {
            $this->itemsChanged = false;
            $this->cacheItems = array();
            foreach ($this->entity->getItems() as $item) {
                $this->cacheItems[] = $this->itemFactory->createApiEntity($item, $this->locale, $this->getCurrencyCode());
            }
        }

        return $this->cacheItems;
    }
601750
public function get($offset = null)
    {
        if (!func_num_args()) {
            $data = [];
            foreach ($this as $value) {
                $data[] = $value;
            }
            return $data;
        }
        if ($entity = $this->_parent->{$this->_through}->get($offset)) {
            return $entity->{$this->_using};
        }
        return;
    }
449937
public function getCacheRepository()
    {
        if (is_null($this->cacheRepository)) {
            $this->cacheRepository = app(config('repository.cache.repository', 'cache'));
        }

        return $this->cacheRepository;
    }
951496
public function getCache()
    {
        if (null === $this->cache) {
            if (isset($this->options['cache']) && is_string($this->options['cache'])) {
                $this->cache = $this->container->get($this->options['cache']);
            }
        }
        
        return $this->cache;
    }
152433
public function getData($entity = array())
    {
        if ($this->accessor == null) {
            $this->accessor = new PropertyAccessor;
        }

        foreach ($this->getFields() as $name => $field) {
            if ($mapping = $field->getMappingName()) {
                if (is_array($entity)) {
                    $entity[$mapping] = $field->getMappingValue();
                } else {
                    $this->accessor->setValue($entity, $mapping, $field->getMappingValue());
                }
            }
        }

        return $entity;
    }
642790
public function get()
    {
        $uri = null;
        if ($this->context) {
            $uri = $this->context->getBaseUri() . '/';
        }
        $uri .= $this->params['endpoint'];
        
        $uri .= sprintf("?page=%d&perpage=%d"
            , $this->page
            , $this->perpage
            );
        
        // add filter if value is not empty
        foreach ($this->filters as $filter) {
            if (! empty($filter['value'])) {
                $uri .= sprintf("&%s=%s"
                    , $filter['field']
                    , rawurlencode($filter['value'])
                    );
            }
        }
        
        $res = $this->client->call($uri);

        // get and preserve pagination
        $lr = Client::getLastResponse();
        $this->pagination = isset($lr['body']) && isset($lr['body']['pagination']) ? $lr['body']['pagination'] : [];
        
        // convert array to Entities collection
        $this->data = [];
        foreach ($res as $data) {
            $this->data[] = (new Entity([], $this->client))->setData($data);
        }
        $this->current = 0;
        
        return $this->data;
    }
509373
private function getCache()
    {
        // cache for single run
        // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)
        if (isset($this->parsed)) {
            return $this->parsed;
        }

        // check from cache first
        $cache = null;
        $cacheId = $this->getCacheId();
        if ($this->cache->isValid($cacheId, 0)) {
            if ($cache = $this->cache->fetch($cacheId)) {
                $cache = unserialize($cache);
            }
        }

        $less = $this->getCompiler();
        $input = $cache ? $cache : $this->filepath;
        $cache = $less->cachedCompile($input);

        if (!is_array($input) || $cache['updated'] > $input['updated']) {
            $cache['lastModified'] = $this->getMaxLastModified($cache);
            $this->cache->store($cacheId, serialize($cache));
        }

        return $this->parsed = $cache;
    }
932680
public function getEntityData()
    {
        $entity = null;
        try {
            $entity = $this->getEntity(
                    $this->getRequest()->getParameter('id')
            );
        } catch (NotFoundException $exception) {
            // The entity does not exist, create a new one from the data in the
            // request.
            $entity = $this->getEntityClass()->newInstanceArgs(
                    $this->getEntityDataFromRequest()
            );
        }

        return $entity->getFieldsData();
    }
865934
public function getEntity()
    {
        if (!isset($this->data['_embedded']['entity']) || !isset($this->resourceClass)) {
            throw new \Exception("No entity found in result");
        }

        $data = $this->data['_embedded']['entity'];
        $resourceClass = $this->resourceClass;
        return new $resourceClass($data, $this->baseUrl, $this->client);
    }
1269214
public function getCache() {
    if (!isset($this->cache))
      $this->cache = new \Doctrine\Common\Cache\ArrayCache;
      
    return $this->cache;
  }
254826
public function getAttributeSet()
    {
        $attributeSet = $this->entity->getAttributeSet();
        if ($attributeSet) {
            return new AttributeSet($attributeSet, $this->locale);
        }

        return null;
    }
1222258
public function getCache()
    {
        if (!$this->cache) {
            $this->cache = new CacheStorageHelper(
                CacheStorageHelper::ADAPTOR_DATABASE,
                'Health',
                $this->em->getConnection()
            );
        }

        return [
            'delays'     => $this->cache->get('delays'),
            'lastCached' => $this->cache->get('lastCached'),
        ];
    }
22924
public function getCached()
    {
        $cached = $this->cache->get(
            $this->getCacheKey(),
            []
        );

        return $this->formatCache($cached);
    }
374226
public function cachedData()
    {
        if (!$this->isCached()) {
            return null;
        }

        $contents = file_get_contents($this->file);

        $serializationEnabled = static::config('serialize');

        $data = $serializationEnabled ? unserialize($contents) : $contents;

        return $data;
    }
1128222
protected static function _cache($entity)
    {
        static $cache;

        if (!$cache) {
            $cache = new AnObjectArray();
        }

        if (!isset($cache[$entity->getRepository()])) {
            $cache[$entity->getRepository()] = new ArrayObject();
        }

        return $cache[$entity->getRepository()];
    }