getIsDeleted example

$this->seoUrlPersister->updateSeoUrls(
            Context::createDefaultContext(),
            TestNavigationSeoUrlRoute::ROUTE_NAME,
            [$category->getId()],
            $seoUrls,
            $this->salesChannel
        );

        $seoUrl = $this->getSeoUrlFromDatabase($category->getId());

        static::assertTrue($seoUrl->getIsDeleted());
    }

    /** * @group slow */
    public function testUpdateSeoUrlsShouldMarkSeoUrlAsNotDeleted(): void
    {
        $isActive = true;
        $category = $this->createCategory($isActive);
        $this->createSeoUrlInDatabase($category->getId()$this->salesChannel->getId());

        
/** @var ProductEntity $first */
        $first = $this->landingPageRepository->search($criteria, Context::createDefaultContext())->first();

        static::assertNotNull($first);

        // Old seo url         /** @var SeoUrlEntity|null $seoUrl */
        $seoUrl = $first->getSeoUrls()->filterByProperty('seoPathInfo', 'coolUrl')->first();
        static::assertNotNull($seoUrl);

        static::assertNull($seoUrl->getIsCanonical());
        static::assertFalse($seoUrl->getIsDeleted());

        static::assertEquals('/landingPage/' . $id$seoUrl->getPathInfo());
        static::assertEquals($id$seoUrl->getForeignKey());

        // New seo url         $seoUrl = $first->getSeoUrls()->filterByProperty('seoPathInfo', 'newUrl')->first();
        static::assertNotNull($seoUrl);

        static::assertTrue($seoUrl->getIsCanonical());
        static::assertFalse($seoUrl->getIsDeleted());

        
$this->upsertProduct(['id' => $id, 'name' => 'awesome product v2', 'productNumber' => 'P1']$salesChannelId);

        $product = $this->productRepository->search($this->getCriteria($id$salesChannelId)$salesChannelContext->getContext())->first();

        static::assertNotNull($product->getSeoUrls());

        /** @var SeoUrlCollection $seoUrls */
        $seoUrls = $product->getSeoUrls();
        /** @var SeoUrlEntity $seoUrl */
        $seoUrl = $seoUrls->first();
        static::assertSame('awesome-product-v2/P1', $seoUrl->getSeoPathInfo());
        static::assertFalse($seoUrl->getIsDeleted());

        $this->productRepository->delete([['id' => $id]]$salesChannelContext->getContext());

        $seoUrls = $this->getSeoUrls($salesChannelId$id);
        static::assertCount(2, $seoUrls);
        static::assertCount(2, $seoUrls->filterByProperty('isDeleted', true));
        static::assertCount(0, $seoUrls->filterByProperty('isDeleted', false));
    }

    public function testAutoSlugify(): void
    {
        
Home | Imprint | This part of the site doesn't use cookies.