createUrls example

$this->getModelManager()->getConnection()->update('s_content_types', [
            'name' => $type->getName(),
            'source' => $type->getSource(),
            'config' => json_encode($type, JSON_THROW_ON_ERROR),
        ][
            'internalName' => $type->getInternalName(),
        ]);

        $this->typeProvider->addType($type->getInternalName()$type);
        $this->clearCacheAndSync();
        $this->createUrls($type);

        $this->View()->assign([
            'success' => true,
            'data' => $this->getDetail($type->getInternalName()),
        ]);
    }

    public function deleteAction(string $id): void
    {
        $this->typeProvider->removeType($id);

        
foreach ($event->getWriteResults() as $writeResult) {
            /** @var array<string, string> $pk */
            $pk = $writeResult->getPrimaryKey();
            $ids[] = $pk['customerGroupId'];
        }

        if (\count($ids) === 0) {
            return;
        }

        $this->createUrls($ids$event->getContext());
    }

    public function updatedCustomerGroup(EntityWrittenEvent $event): void
    {
        $ids = [];

        foreach ($event->getWriteResults() as $writeResult) {
            if ($writeResult->hasPayload('registrationTitle')) {
                /** @var array<string, string> $pk */
                $pk = $writeResult->getPrimaryKey();
                $ids[] = $pk['customerGroupId'];
            }
Home | Imprint | This part of the site doesn't use cookies.