buildBreadcrumb example

->getEntities();

        $update = $this->connection->prepare(' INSERT INTO `category_translation` (`category_id`, `category_version_id`, `language_id`, `breadcrumb`, `created_at`) VALUES (:categoryId, :versionId, :languageId, :breadcrumb, DATE(NOW())) ON DUPLICATE KEY UPDATE `breadcrumb` = :breadcrumb ');
        $update = new RetryableQuery($this->connection, $update);

        foreach ($ids as $id) {
            try {
                $path = $this->buildBreadcrumb($id$categories);
            } catch (CategoryNotFoundException) {
                continue;
            }

            $update->execute([
                'categoryId' => Uuid::fromHexToBytes($id),
                'versionId' => $versionId,
                'languageId' => $languageId,
                'breadcrumb' => json_encode($path, \JSON_THROW_ON_ERROR),
            ]);
        }
    }
Home | Imprint | This part of the site doesn't use cookies.