@param $listUuid

@return array
555226
public function getHeaders($listUuid)
    {
        $sql = 'SELECT
                `headers`
                FROM `'.self::LIST_COLLECTION_TABLE_NAME.'` 
                WHERE `uuid` = :uuid';

        $stmt = $this->pdo->prepare($sql);
        $stmt->bindParam(':uuid', $listUuid);
        $stmt->execute();

        if ($list = $stmt->fetchAll(\PDO::FETCH_ASSOC)) {
            $headers = $list[0]['headers'];

            if (SerializeChecker::isSerialized($headers)) {
                return unserialize($headers);
            }

            return $headers;
        }

        return null;
    }
887353
public function findOrFailByUuid($uuid, $columns = ['*'])
    {
        $result = $this->findByUuid($uuid, $columns);

        if (is_array($uuid)) {
            if (count($result) == count(array_unique($uuid))) {
                return $result;
            }
        } elseif (! is_null($result)) {
            return $result;
        }

        throw new NotFoundHttpException('Resource \'' . class_basename(get_class($this->model)) . '\' with given UUID ' . $uuid . ' not found');
    }
911910
public function getPassword($uuid)
	{
		if($this->entries != null)
		{
			foreach($this->entries as &$entry)
			{
				if($entry->uuid === $uuid)
					return $entry->password;
			}
		}
		if($this->groups != null)
		{
			foreach($this->groups as &$group)
			{
				$value = $group->getPassword($uuid);
				if($value != null)
					return $value;
			}
		}
		return null;
	}
145480
public function fromAggregate($uuid)
    {
        $stream = $this->repo->byUuid(new AggregateUuid($uuid), $this->returnType);

        return ($stream) ?: [];
    }
44983
public function getElement(ListElementUuid $uuid)
    {
        if (!$this->hasElement($uuid)) {
            throw new ListElementKeyDoesNotExistException('Invalid key '.$uuid->getUuid());
        }

        return $this->elements[$uuid->getUuid()];
    }
242184
public function whereUuidKey($uuid)
    {
        if (is_array($uuid) || $uuid instanceof Arrayable) {
            $this->query->whereIn($this->model->getQualifiedUuidKeyName(), $uuid);

            return $this;
        }

        return $this->where($this->model->getQualifiedUuidKeyName(), '=', $uuid);
    }
1222315
public function findListByUuid($listUuid)
    {
        $collection = ($this->memcached->get($listUuid.self::SEPARATOR.self::CHUNK.'-1')) ?: [];
        $numberOfChunks = $this->getNumberOfChunks($listUuid);

        for ($i = 2; $i <= $numberOfChunks; ++$i) {
            $collection = (array) array_merge($collection, $this->memcached->get($listUuid.self::SEPARATOR.self::CHUNK.'-'.$i));
        }

        return (array) array_map('unserialize', $collection);
    }
682765
public function getListnameByListId($listID) {
        $list = $this->model->where('id', $listID)->first();

        return $list->title;
    }
329639
public function getCounter($listUuid)
    {
        if ($this->existsListInIndex($listUuid)) {
            $index = $this->getIndex($listUuid);

            return $index['size'];
        }

        return 0;
    }
705040
public function deleteElement($listUuid, $elementUuid)
    {
        $numberOfChunks = $this->getNumberOfChunks($listUuid);
        $chunkSize = $this->getChunkSize($listUuid);

        for ($i = 1; $i <= $numberOfChunks; ++$i) {
            $chunkNumber = $listUuid.self::SEPARATOR.self::CHUNK.'-'.$i;
            $chunk = apcu_fetch($chunkNumber);

            if (array_key_exists($elementUuid, $chunk)) {
                // delete elements from chunk
                unset($chunk[(string) $elementUuid]);
                apcu_delete($chunkNumber);
                apcu_store($chunkNumber, $chunk);

                // update list index
                $prevIndex = $this->getIndex($listUuid);
                $this->addOrUpdateListToIndex(
                    $listUuid,
                    ($prevIndex['size'] - 1),
                    $numberOfChunks,
                    $chunkSize,
                    $prevIndex['ttl']
                );

                // delete headers if counter = 0
                $counter = $this->getCounter($listUuid);
                $headersKey = $listUuid.self::SEPARATOR.self::HEADERS;

                if ($counter === 0) {
                    apcu_delete($headersKey);
                }

                break;
            }
        }
    }
862765
public function updateElement($listUuid, $elementUuid, $data)
    {
        $numberOfChunks = $this->getNumberOfChunks($listUuid);
        $ttl = ($this->getTtl($listUuid) > 0) ? $this->getTtl($listUuid) : null;

        for ($i = 1; $i <= $numberOfChunks; ++$i) {
            $chunkNumber = $listUuid.self::SEPARATOR.self::CHUNK.'-'.$i;
            $chunk = $this->memcached->get($chunkNumber);

            if (array_key_exists($elementUuid, $chunk)) {
                $listElement = $this->findElement(
                    (string) $listUuid,
                    (string) $elementUuid
                );

                $updatedElementBody = $this->updateListElementBody($listElement, $data);
                if (!ListElementConsistencyChecker::isConsistent($updatedElementBody, $this->findListByUuid($listUuid))) {
                    throw new ListElementNotConsistentException('Element '.(string) $elementUuid.' is not consistent with list data.');
                }

                $arrayOfElements = $this->memcached->get($listUuid);
                $updatedElement = new ListElement(
                    new ListElementUuid($elementUuid),
                    $updatedElementBody
                );
                $body = $updatedElement->getBody();
                $arrayOfElements[(string) $elementUuid] = $body;

                $this->memcached->replace(
                    (string) $chunkNumber,
                    $arrayOfElements,
                    $ttl
                );

                break;
            }
        }
    }
24843
public function getSubscriberEmails($listId)
    {
        $emails = [];
        $members = [];
        $offset=0;
        $maxresult = 200;
        $result = $this->mailchimp->get("lists/$listId/members", ['count'=> $maxresult]);

        if (!$this->mailchimp->success()) {
            $this->throwMailchimpError($this->mailchimp->getLastResponse());
        }

        $totalItems = $result['total_items'];
        $members = array_merge($members, $result['members']);

        while ($offset < $totalItems) {
            $offset+=$maxresult;
            $result = $this->mailchimp->get("lists/$listId/members", [
                        'count'         => $maxresult,
                        'offset'        => $offset
                    ]);

            if (!$this->mailchimp->success()) {
                $this->throwMailchimpError($this->mailchimp->getLastResponse());
            }
            $members = array_merge($members, $result['members']);
        };

        foreach ($members as $key => $member) {
            array_push($emails, $member['email_address']);
        }

        return $emails;
    }
567184
public function exists($listUuid)
    {
        $listFirstChunk = apcu_fetch($listUuid.self::SEPARATOR.self::CHUNK.'-1');

        return isset($listFirstChunk);
    }
692044
public function cgetAction(Request $request, $uuid)
    {
        $locale = $this->getRequestParameter($request, 'language', true);

        $document = $this->get('sulu_document_manager.document_manager')->find($uuid, $request->query->get('language'));
        $versions = array_reverse(array_filter($document->getVersions(), function($version) use ($locale) {
            /* @var Version $version */
            return $version->getLocale() === $locale;
        }));
        $total = count($versions);

        $listRestHelper = $this->get('sulu_core.list_rest_helper');
        $limit = $listRestHelper->getLimit();

        $versions = array_slice($versions, $listRestHelper->getOffset(), $limit);

        $userIds = array_unique(array_map(function($version) {
            /* @var Version $version */
            return $version->getAuthor();
        }, $versions));

        $users = $this->get('sulu_security.user_repository')->findUsersById($userIds);
        $fullNamesByIds = [];
        foreach ($users as $user) {
            $fullNamesByIds[$user->getId()] = $user->getContact()->getFullName();
        }

        $versionData = [];
        foreach ($versions as $version) {
            $versionData[] = [
                'id' => str_replace('.', '_', $version->getId()),
                'locale' => $version->getLocale(),
                'author' => array_key_exists($version->getAuthor(), $fullNamesByIds)
                    ? $fullNamesByIds[$version->getAuthor()] : '',
                'authored' => $version->getAuthored(),
            ];
        }

        $versionCollection = new ListRepresentation(
            $versionData,
            'versions',
            'get_node_versions',
            [
                'uuid' => $uuid,
                'language' => $locale,
                'webspace' => $request->get('webspace'),
            ],
            $listRestHelper->getPage(),
            $limit,
            $total
        );

        return $this->handleView($this->view($versionCollection));
    }
565169
public function th_getUidTopics($uid)
    {
        $arr = [];
        foreach ($this->subArr as $topic => $set) {
            if ($set->contains($uid)) {
                $arr[] = $topic;
            }
        }
        return $arr;
    }
407421
public function getAction($uuid, Request $request)
    {
        $locale = $this->getRequestParameter($request, 'locale', true);
        $document = $this->getDocumentManager()->find(
            $uuid,
            $locale
        );

        return $this->handleView(
            $this->view($document)->setSerializationContext(
                SerializationContext::create()
                    ->setSerializeNull(true)
                    ->setGroups(['defaultPage', 'defaultArticle', 'smallArticlePage'])
            )
        );
    }
483054
public function findById($listId)
    {
        $listData = $this->mailchimp->get("lists/$listId");

        if (!$this->mailchimp->success()) {
            $this->throwMailchimpError($this->mailchimp->getLastResponse());
        }
        return $listData;
    }