Get a cell by its uuid.

@param $uuid

@return Cell|null
174721
public function getCell($uuid)
    {
        $found = null;
        foreach ($this->cells as $cell) {
            if ($cell->getUuid() === $uuid) {
                $found = $cell;
                break;
            }
        }

        return $found;
    }
483395
public function getAnswer($questionUuid)
    {
        $found = null;
        foreach ($this->answers as $answer) {
            if ($answer->getQuestionId() === $questionUuid) {
                $found = $answer;
                break;
            }
        }

        return $found;
    }
1222737
public function getQuestion($questionUuid)
    {
        $question = null;

        if (empty($this->decodedStructure)) {
            $this->decodeStructure();
        }

        foreach ($this->decodedStructure['steps'] as $step) {
            foreach ($step['items'] as $item) {
                if ($item['id'] === $questionUuid) {
                    $question = $item;
                    break 2;
                }
            }
        }

        return $question;
    }
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'])
            )
        );
    }
19577
public function getItem($uuid)
    {
        $found = null;
        foreach ($this->items as $item) {
            if ($item->getUuid() === $uuid) {
                $found = $item;
                break;
            }
        }

        return $found;
    }
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;
    }
395200
public function show($uuid)
    {
        if ($uuid instanceof Service) {
            $uuid = $uuid->getUuid();
        }

        $response = $this->httpClient->get(
            $this->getResourceUrl($uuid),
            []
        );

        return ServiceResponse::createFromHttpResponse($response);
    }
646439
public function getUrls(
        $uuid,
        $token = null
    ) {
        try {
            if (empty($token)) {
                $response = $this->client->get($uuid);
            } else {
                $response = $this->client->get($uuid, [
                    'headers' => [
                        'Authorization' => $token,
                    ],
                ]);
            }

            $this->log->debug("Gemini GET response", [
                'uuid' => $uuid,
                'response' => $response,
            ]);

            return json_decode($response->getBody(), true);
        } catch (RequestException $e) {
            if ($e->getResponse()->getStatusCode() == 404) {
                return null;
            }

            throw $e;
        }
    }
278563
public function getHole($uuid)
    {
        $found = null;
        foreach ($this->holes as $hole) {
            if ($hole->getUuid() === $uuid) {
                $found = $hole;
                break;
            }
        }

        return $found;
    }
68754
public function get($uuid)
    {
        $model = new static::$model;

        $resource = $model::with($model::$localWith)->where($model->getKeyName(), '=', $uuid)->first();

        if (! $resource) {
            throw new NotFoundHttpException('Resource \'' . class_basename(static::$model) . '\' with given UUID ' . $uuid . ' not found');
        }

        $this->authorizeUserAction('view', $resource);

        return $this->response->item($resource, $this->getTransformer());
    }
75762
public function getIndex($listUuid = null)
    {
        $lt = self::LIST_ELEMENT_TABLE_NAME;
        $lc = self::LIST_COLLECTION_TABLE_NAME;

        $sql = 'SELECT
                `'.$lc.'`.`uuid`,
                `'.$lc.'`.`headers`,
                `'.$lc.'`.`created_at`
                FROM `'.$lt.'` 
                INNER JOIN `'.$lc.'` 
                ON `'.$lt.'`.`list` = `'.$lc.'`.`uuid`';

        if ($listUuid) {
            $sql .= 'WHERE `'.$lc.'`.`uuid` = :list';
        }

        $stmt = $this->pdo->prepare($sql);
        if ($listUuid) {
            $stmt->bindParam(':list', $listUuid);
        }
        $stmt->execute();

        $list = $stmt->fetchAll(\PDO::FETCH_ASSOC);

        $index = [];

        foreach ($list as $item) {
            $index[$item['uuid']] = [
                'uuid' => $item['uuid'],
                'created_on' => \DateTime::createFromFormat('Y-m-d H:i:s.u', $item['created_at']),
                'size' => $this->getCounter($item['uuid']),
                'chunks' => 0,
                'chunk-size' => 0,
                'headers' => $this->getHeaders($item['uuid']),
                'ttl' => 0,
            ];
        }

        return $index;
    }
851689
public function byUuid(AggregateUuid $uuid, $returnType = self::RETURN_AS_ARRAY)
    {
        if ($document = $this->events->find(['uuid' => (string) $uuid])->toArray()) {
            return $this->buildEventAggregate($document, $returnType);
        }

        return null;
    }
275681
public function getQuestion($uuid)
    {
        $found = null;
        foreach ($this->stepQuestions as $stepQuestion) {
            if ($stepQuestion->getQuestion()->getUuid() === $uuid) {
                $found = $stepQuestion->getQuestion();
                break;
            }
        }

        return $found;
    }
608228
public function getFileFromUuid($uuid)
    {
        if ($path = $this->getPathFromUuid($uuid)) {
            if (is_dir($this->container->get('huh.utils.container')->getProjectDir().\DIRECTORY_SEPARATOR.$path)) {
                return null;
            }

            return new File($path);
        }
    }
94855
public function getOddItem($uuid)
    {
        $found = null;
        foreach ($this->oddItems as $oddItem) {
            if ($oddItem->getItem()->getUuid() === $uuid) {
                $found = $oddItem;
                break;
            }
        }

        return $found;
    }
1108073
public static function toOptimized($uuid)
    {
        $uuid = preg_replace('/\-/', null, $uuid);
        return hex2bin(substr($uuid, 12, 4)) .
            hex2bin(substr($uuid, 8, 4)) .
            hex2bin(substr($uuid, 0, 8)) .
            hex2bin(substr($uuid, 16, 4)) .
            hex2bin(substr($uuid, 20));
    }
1212360
public static function getByUuid(string $uuid): ?WebhookEvent
    {
        $event = WebhookEvent::get("/webhook-events/:uuid", [ "uuid" => $uuid ])->first();

        /** @var WebhookEvent $event */
        return $event;
    }