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

StorageHandler.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Persistence\Legacy\Content;
8
9 use eZ\Publish\SPI\Persistence\Content\Field;
10 use eZ\Publish\SPI\Persistence\Content\VersionInfo;
11
15 class StorageHandler
16 {
22 protected $storageRegistry;
23
29 protected $context;
30
37 public function __construct(StorageRegistry $storageRegistry, array $context)
38 {
39 $this->storageRegistry = $storageRegistry;
40 $this->context = $context;
41 }
42
49 public function storeFieldData(VersionInfo $versionInfo, Field $field)
50 {
51 return $this->storageRegistry->getStorage($field->type)->storeFieldData(
52 $versionInfo,
53 $field,
54 $this->context
55 );
56 }
57
63 public function copyFieldData(VersionInfo $versionInfo, Field $field, Field $originalField)
64 {
65 return $this->storageRegistry->getStorage($field->type)->copyLegacyField(
66 $versionInfo,
67 $field,
68 $originalField,
69 $this->context
70 );
71 }
72
79 public function getFieldData(VersionInfo $versionInfo, Field $field)
80 {
81 $storage = $this->storageRegistry->getStorage($field->type);
82 if ($storage->hasFieldData()) {
83 $storage->getFieldData($versionInfo, $field, $this->context);
84 }
85 }
86
94 public function deleteFieldData($fieldType, VersionInfo $versionInfo, array $ids)
95 {
96 $this->storageRegistry->getStorage($fieldType)
97 ->deleteFieldData($versionInfo, $ids, $this->context);
98 }
99 }
eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler
Handler for external storages.
Definition: StorageHandler.php:16
eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler\storeFieldData
storeFieldData(VersionInfo $versionInfo, Field $field)
Stores data from $field in its corresponding external storage.
Definition: StorageHandler.php:49
eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler\$context
$context
Definition: StorageHandler.php:29
eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler\copyFieldData
copyFieldData(VersionInfo $versionInfo, Field $field, Field $originalField)
Definition: StorageHandler.php:63
eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler\getFieldData
getFieldData(VersionInfo $versionInfo, Field $field)
Fetches external data for $field from its corresponding external storage.
Definition: StorageHandler.php:79
eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler\$storageRegistry
$storageRegistry
Definition: StorageHandler.php:22
eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler\deleteFieldData
deleteFieldData($fieldType, VersionInfo $versionInfo, array $ids)
Deletes data for field $ids from external storage of $fieldType.
Definition: StorageHandler.php:94
eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler\__construct
__construct(StorageRegistry $storageRegistry, array $context)
Creates a new storage handler.
Definition: StorageHandler.php:37
eZ\Publish\Core\Persistence\Legacy\Content\StorageRegistry
Registry for external storages.
Definition: StorageRegistry.php:16
eZ\Publish\SPI\Persistence\Content\Field
Definition: SPI/Persistence/Content/Field.php:12
eZ\Publish\SPI\Persistence\Content\VersionInfo
This class holds version information data.
Definition: SPI/Persistence/Content/VersionInfo.php:15
eZ\Publish\Core\Persistence\Legacy\Content
Definition: FieldHandler.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.