deleteContentType example


    }

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

        $this->getModelManager()->getConnection()->delete('s_content_types', [
            'internalName' => $id,
        ]);

        $this->cleanupService->deleteContentType($id);

        $this->clearCacheAndSync();

        $this->View()->assign('success', true);
    }

    public function detailAction(string $id): void
    {
        $this->View()->assign('success', true);
        $this->View()->assign('data', $this->getDetail($id));
    }

    
return $type->getInternalName();
        }$types);

        if (!empty($types)) {
            $names = $this->connection->executeQuery('SELECT internalName FROM s_content_types WHERE source IS NOT NULL AND internalName NOT IN(:names)', [
                'names' => $types,
            ][
                'names' => Connection::PARAM_STR_ARRAY,
            ])->fetchAll(PDO::FETCH_COLUMN);

            foreach ($names as $name) {
                $this->cleanupService->deleteContentType($name);
            }

            $this->connection->executeQuery('DELETE FROM s_content_types WHERE source IS NOT NULL AND internalName NOT IN(:names)', [
                'names' => $types,
            ][
                'names' => Connection::PARAM_STR_ARRAY,
            ]);
        } else {
            $this->connection->executeQuery('DELETE FROM s_content_types WHERE source IS NOT NULL');
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.