{@inheritDoc}
@see \Seeren\Cache\Pool\AbstractCacheItemPool::poolGetItem()
175393
protected final function poolGetItem(string $key): CacheItemInterface
    {
        try {
            $stream = new Stream(
                $this->includePath . $this->getTarget($key),
                Stream::MODE_C_MORE);
            $serialized = $stream->__toString();
            $stream->detach();
            if ($serialized) {
                $item = unserialize($serialized);
                if (is_object($item) && $item instanceof CacheItem) {
                    return $item;
                }
            }
            throw new InvalidArgumentException("Item must implement psr-6");
        } catch (InvalidArgumentException $e) {
            return $this->createItem($key);
        }
    }
740798
protected function getIndexQueueItem()
    {
        /** @var $indexQueue Queue */
        $indexQueue = GeneralUtility::makeInstance(Queue::class);
        $indexQueueItem = $indexQueue->getItem($this->request->getParameter('item'));
        return $indexQueueItem;
    }
588134
public function offsetGet($offset)
    {
        return $this->offsetExists($offset) ? array_get($this->items, $offset) : null;
    }
694985
public function get($key)
	{
		$item = new Item($key);

		if ($this->exists($key))
		{
			$item->setValue(xcache_get($key));
		}

		return $item;
	}
517276
public function acquire($context = SessionPoolInterface::CONTEXT_READ)
    {
        // Try to get a session, run maintenance on the pool, and calculate if
        // we need to create any new sessions.
        list($session, $toCreate) = $this->config['lock']->synchronize(function () {
            $toCreate = [];
            $session = null;
            $shouldSave = false;
            $item = $this->cacheItemPool->getItem($this->cacheKey);
            $data = (array) $item->get() ?: $this->initialize();

            // If the queue has items in it, let's shift one off, however if the
            // queue is empty and we have maxed out the number of sessions let's
            // attempt to purge any orphaned items from the pool to make room
            // for more.
            if ($data['queue']) {
                $session = $this->getSession($data);
                $shouldSave = true;
            } elseif ($this->config['maxSessions'] <= $this->getSessionCount($data)) {
                $this->purgeOrphanedInUseSessions($data);
                $this->purgeOrphanedToCreateItems($data);
                $session = $this->getSession($data);
                $shouldSave = true;
            }

            if (!$session) {
                $count = $this->getSessionCount($data);

                if ($count < $this->config['maxSessions']) {
                    $toCreate = $this->buildToCreateList(1);
                    $data['toCreate'] += $toCreate;
                    $shouldSave = true;
                }
            }

            if ($shouldSave) {
                $this->cacheItemPool->save($item->set($data));
            }

            return [$session, $toCreate];
        });

        // Create a session if needed.
        if ($toCreate) {
            $createdSessions = $this->createSessions(count($toCreate));
            $hasCreatedSessions = count($createdSessions) > 0;

            $session = $this->config['lock']->synchronize(function () use (
                $toCreate,
                $createdSessions,
                $hasCreatedSessions
            ) {
                $session = null;
                $item = $this->cacheItemPool->getItem($this->cacheKey);
                $data = $item->get();
                $data['queue'] = array_merge($data['queue'], $createdSessions);

                // Now that we've created the session, we can remove it from
                // the list of intent.
                foreach ($toCreate as $id => $time) {
                    unset($data['toCreate'][$id]);
                }

                if ($hasCreatedSessions) {
                    $session = array_shift($data['queue']);
                    $data['inUse'][$session['name']] = $session + [
                        'lastActive' => $this->time()
                    ];

                    if ($this->config['shouldAutoDownsize']) {
                        $this->manageSessionsToDelete($data);
                    }
                }

                $this->cacheItemPool->save($item->set($data));

                return $session;
            });
        }

        if ($session) {
            $session = $this->handleSession($session);
        }

        // If we don't have a session, let's wait for one or throw an exception.
        if (!$session) {
            if (!$this->config['shouldWaitForSession']) {
                throw new \RuntimeException('No sessions available.');
            }

            $session = $this->waitForNextAvailableSession();
        }

        if ($this->deleteQueue) {
            $this->deleteSessions($this->deleteQueue);
            $this->deleteQueue = [];
        }

        return $this->database->session($session['name']);
    }
1329728
protected function createItem(/*# string */ $key)/*# : CacheItemInterface */
    {
        // validate key first
        $this->validateKey($key);

        // use item factory
        if (is_callable($this->item_factory)) {
            $func = $this->item_factory;
            $item = $func($key, $this, $this->item_config);

        // default CacheItem class
        } else {
            $item = new CacheItem($key, $this, $this->item_config);
        }

        return $item;
    }
56006
public function getItem($cacheId, & $success = null)
    {
        if ($this->hasItem($cacheId)) {
            $success = true;
            $cacheId = $this->normalizeKey($cacheId);

            return $this->cache->get($cacheId);
        }

        $success = false;

        return null;
    }
600274
protected function getCacheItem($key, $item, $defaultKey, $defaultItem = null)
    {
        if (empty($cache = $this->getCache($key, $defaultKey))) {
            return $defaultItem;
        }
        if (!is_array($cache)) {
            throw new DirectAdminException("Cache item $key is not an array");
        }
        return isset($cache[$item]) ? $cache[$item] : $defaultItem;
    }
493241
protected function cachePool()
    {
        if ($this->cachePool === null) {
            throw new RuntimeException(sprintf(
                'Cache Pool is not defined for "%s"',
                get_class($this)
            ));
        }

        return $this->cachePool;
    }
242551
public function getGetItem($key)
    {
        return isset($this->get[$key]) ? $this->get[$key] : null;
    }
1346148
public function getItem($key): CacheItem
    {
        if (isset($this->data[$key])) {
            return $this->data[$key];
        }

        $cacheItem = new CacheItem($key);

        if ($this->has($key)) {
            $cacheItem->set($this->get($key));
        }

        $this->data[$key] = $cacheItem;

        return $cacheItem;
    }
812891
public function getItems($offset, $limit) {
		if ($this->_data === null) {
			throw new RuntimeException('Wasn\'t data been provided');
		}
		
		$items = array_slice($this->_data, $offset, $limit);
		
		if ($this->_wrapIntoCollection) {
			return new Collection($items, $this->_modelClass, $this->_primary);
		} else {
			return new ArrayIterator($items);
		}
	}
1213639
public function getDataPoolValue($variable)
    {
        $value = null;
        $pool  = $this->getDataPool();

        if (
            true === isset($pool[$variable]) &&
            true === isset($pool[$variable])
        ) {
            $value = $pool[$variable];
        }

        return $value;
    }
1201642
public function offsetGet($offset)
    {
        $value = isset($this->collection[$offset]) ? $this->collection[$offset] : null;
        if ($value) {
            return $value;
        }
        if ($this->couldHaveMoreItems()) {
            $this->fetchNext();
            return $this->offsetGet($offset);
        } else {
            return $value;
        }
    }
1135232
public function cache(CacheItemInterface $item)
    {
        $content = $this->execute();
        $item->set($content);

        return $item;
    }
854034
public function get($itemsToGet = 0, $offset = 0)
    {
        $q = $this->executeBase();
        // handle order by
        $this->setupAttributeSort();
        $this->setupAutoSort();
        $this->setupSortByString();

        if ($this->sortByString != '') {
            $q .= 'order by ' . $this->sortByString . ' ';
        }
        if ($this->itemsPerPage > 0 && (intval($itemsToGet) || intval($offset))) {
            $q .= 'limit ' . $offset . ',' . $itemsToGet . ' ';
        }

        $db = Loader::db();
        $resp = $db->GetAll($q);

        $this->start = $offset;

        return $resp;
    }
403056
protected function getItem($key)
    {
        $cache_file = $this->path($key);
        if (!file_exists($cache_file) || !is_readable($cache_file)) {
            return false;
        }

        $data = file_get_contents($cache_file);
        if (empty($data)) return false;
        $cache_data = unserialize($data);

        if ($cache_data === false) {
            return false;
        }

        $check_expire = $this->checkExpire($cache_data);
        if ($check_expire === false) {
            $this->delete($key);
            return false;
        }

        return $cache_data;
    }