Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler;
8
9 use eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler;
10 use eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway;
11 use eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater;
12 use eZ\Publish\SPI\Persistence\Content\Type;
13
17 class DoctrineDatabase extends Handler
18 {
20 protected $contentTypeGateway;
21
27 protected $contentUpdater;
28
35 public function __construct(Gateway $contentTypeGateway, ContentUpdater $contentUpdater)
36 {
37 $this->contentTypeGateway = $contentTypeGateway;
38 $this->contentUpdater = $contentUpdater;
39 }
40
47 public function updateContentObjects(Type $fromType, Type $toType)
48 {
49 $this->contentUpdater->applyUpdates(
50 $fromType->id,
51 $this->contentUpdater->determineActions($fromType, $toType)
52 );
53 }
54
60 public function deleteOldType(Type $fromType)
61 {
62 $this->contentTypeGateway->delete($fromType->id, $fromType->status, $fromType->fieldDefinitions);
63 }
64
71 public function publishNewType(Type $toType, $newStatus)
72 {
73 $this->contentTypeGateway->publishTypeAndFields(
74 $toType->id,
75 $toType->status,
76 $newStatus
77 );
78 }
79 }
eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater
Class to update content objects to a new type version.
Definition: ContentUpdater.php:20
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway\DoctrineDatabase
Doctrine database based content type gateway.
Definition: Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php:31
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway
Base class for content type gateways.
Definition: Persistence/Legacy/Content/Type/Gateway.php:19
eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler\DoctrineDatabase\deleteOldType
deleteOldType(Type $fromType)
Deletes $fromType and all of its field definitions.
Definition: Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php:60
eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler\DoctrineDatabase\$contentTypeGateway
$contentTypeGateway
Definition: Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php:20
eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler\DoctrineDatabase\publishNewType
publishNewType(Type $toType, $newStatus)
Publishes $toType to $newStatus.
Definition: Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php:71
eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler\DoctrineDatabase\__construct
__construct(Gateway $contentTypeGateway, ContentUpdater $contentUpdater)
Creates a new content type update handler.
Definition: Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php:35
eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler\DoctrineDatabase\updateContentObjects
updateContentObjects(Type $fromType, Type $toType)
Updates existing content objects from $fromType to $toType.
Definition: Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php:47
eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler\DoctrineDatabase\$contentUpdater
$contentUpdater
Definition: Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php:27
eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler
Base class for update handlers.
Definition: Core/Persistence/Legacy/Content/Type/Update/Handler.php:15
eZ\Publish\SPI\Persistence\Content\Type
SPI Persistence Content\Type value object.
Definition: SPI/Persistence/Content/Type.php:15
eZ\Publish\Core\Persistence\Legacy\Content\Type\Gateway
Definition: Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php:7
eZ\Publish\Core\Persistence\Legacy\Content\Type\Update\Handler
Definition: DeferredLegacy.php:7
eZ\Publish\SPI\Persistence\Content\Type
Definition: SPI/Persistence/Content/Type/CreateStruct.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.