|
| 1 | +<?php |
| 2 | +declare(strict_types=1); |
| 3 | + |
| 4 | +namespace Pimcore\Bundle\StaticResolverBundle\Contract\Models\DataObject; |
| 5 | + |
| 6 | +use Exception; |
| 7 | +use Pimcore\Model\Asset; |
| 8 | +use Pimcore\Model\DataObject\AbstractObject; |
| 9 | +use Pimcore\Model\DataObject\ClassDefinition; |
| 10 | +use Pimcore\Model\DataObject\ClassDefinition\Data; |
| 11 | +use Pimcore\Model\DataObject\ClassDefinition\Layout; |
| 12 | +use Pimcore\Model\DataObject\Concrete; |
| 13 | +use Pimcore\Model\DataObject\Fieldcollection\Data\AbstractData as FieldCollectionData; |
| 14 | +use Pimcore\Model\DataObject\Folder; |
| 15 | +use Pimcore\Model\DataObject\Objectbrick\Data\AbstractData as ObjectBrickData; |
| 16 | +use Pimcore\Model\DataObject\Service; |
| 17 | +use Pimcore\Model\Document; |
| 18 | +use Pimcore\Model\Element\ElementInterface; |
| 19 | +use Pimcore\Model\UserInterface; |
| 20 | +use Pimcore\Model\DataObject\Fieldcollection; |
| 21 | +use Pimcore\Model\DataObject\Objectbrick; |
| 22 | +use Pimcore\Model; |
| 23 | + |
| 24 | +class DataObjectServiceResolverContract implements DataObjectServiceResolverContractInterface |
| 25 | +{ |
| 26 | + |
| 27 | + public function useInheritedValues(bool $inheritValues, callable $fn, array $fnArgs = []): mixed |
| 28 | + { |
| 29 | + return Service::useInheritedValues($inheritValues, $fn, $fnArgs); |
| 30 | + } |
| 31 | + |
| 32 | + public function rewriteIds(AbstractObject $object, array $rewriteConfig, array $params = []): AbstractObject |
| 33 | + { |
| 34 | + return Service::rewriteIds($object, $rewriteConfig, $params); |
| 35 | + } |
| 36 | + |
| 37 | + /** |
| 38 | + * @throws Exception |
| 39 | + */ |
| 40 | + public function createFolderByPath(string $path, array $options = []): Folder |
| 41 | + { |
| 42 | + return Service::createFolderByPath($path, $options); |
| 43 | + } |
| 44 | + |
| 45 | + public function pathExists(string $path, ?string $type = null): bool |
| 46 | + { |
| 47 | + return Service::pathExists($path, $type); |
| 48 | + } |
| 49 | + |
| 50 | + /** |
| 51 | + * @param Data[] $targetList |
| 52 | + */ |
| 53 | + public function extractFieldDefinitions( |
| 54 | + Data|Layout $layout, |
| 55 | + string $targetClass, |
| 56 | + array $targetList, |
| 57 | + bool $insideDataType |
| 58 | + ): array |
| 59 | + { |
| 60 | + |
| 61 | + return Service::extractFieldDefinitions($layout, $targetClass, $targetList, $insideDataType); |
| 62 | + } |
| 63 | + |
| 64 | + public function getSuperLayoutDefinition(Concrete $object): mixed |
| 65 | + { |
| 66 | + |
| 67 | + return Service::getSuperLayoutDefinition($object); |
| 68 | + } |
| 69 | + |
| 70 | + public function createSuperLayout(Data|Layout $layout): void |
| 71 | + { |
| 72 | + Service::createSuperLayout($layout); |
| 73 | + } |
| 74 | + |
| 75 | + /** |
| 76 | + * @return Concrete[] |
| 77 | + */ |
| 78 | + public function getObjectsReferencingUser(int $userId): array |
| 79 | + { |
| 80 | + return Service::getObjectsReferencingUser($userId); |
| 81 | + } |
| 82 | + |
| 83 | + public function getLanguagePermissions( |
| 84 | + FieldCollectionData|ObjectBrickData|AbstractObject $object, |
| 85 | + UserInterface $user, |
| 86 | + string $type |
| 87 | + ): ?array |
| 88 | + { |
| 89 | + return Service::getLanguagePermissions($object, $user, $type); |
| 90 | + } |
| 91 | + |
| 92 | + public function calculateCellValue( |
| 93 | + AbstractObject $object, |
| 94 | + array $helperDefinitions, |
| 95 | + string $key, |
| 96 | + array $context = [] |
| 97 | + ): mixed |
| 98 | + { |
| 99 | + return Service::calculateCellValue($object, $helperDefinitions, $key, $context); |
| 100 | + } |
| 101 | + |
| 102 | + public function getLayoutPermissions(string $classId, ?array $permissionSet = null): ?array |
| 103 | + { |
| 104 | + return Service::getLayoutPermissions($classId, $permissionSet); |
| 105 | + } |
| 106 | + |
| 107 | + public function getFieldForBrickType(ClassDefinition $class, string $bricktype): int|string|null |
| 108 | + { |
| 109 | + return Service::getFieldForBrickType($class, $bricktype); |
| 110 | + } |
| 111 | + |
| 112 | + public function hasInheritableParentObject(Concrete $object): ?Concrete |
| 113 | + { |
| 114 | + return Service::hasInheritableParentObject($object); |
| 115 | + } |
| 116 | + |
| 117 | + public function loadAllObjectFields(AbstractObject $object): void |
| 118 | + { |
| 119 | + Service::loadAllObjectFields($object); |
| 120 | + } |
| 121 | + |
| 122 | + public function getOptionsForSelectField( |
| 123 | + string|Concrete $object, |
| 124 | + ClassDefinition\Data\Multiselect|ClassDefinition\Data\Select|string $definition |
| 125 | + ): array |
| 126 | + { |
| 127 | + return Service::getOptionsForSelectField($object, $definition); |
| 128 | + } |
| 129 | + |
| 130 | + public function getOptionsForMultiSelectField( |
| 131 | + string|Concrete $object, |
| 132 | + ClassDefinition\Data\Multiselect|ClassDefinition\Data\Select|string $fieldname |
| 133 | + ): array |
| 134 | + { |
| 135 | + return Service::getOptionsForMultiSelectField($object, $fieldname); |
| 136 | + } |
| 137 | + |
| 138 | + public function getValidLayouts(Concrete $object): array |
| 139 | + { |
| 140 | + return Service::getValidLayouts($object); |
| 141 | + } |
| 142 | + |
| 143 | + public function synchronizeCustomLayout(ClassDefinition\CustomLayout $customLayout): void |
| 144 | + { |
| 145 | + Service::synchronizeCustomLayout($customLayout); |
| 146 | + } |
| 147 | + |
| 148 | + public function cloneDefinition(mixed $definition): mixed |
| 149 | + { |
| 150 | + return Service::cloneDefinition($definition); |
| 151 | + } |
| 152 | + |
| 153 | + public function getUniqueKey(ElementInterface $element, int $nr = 0): string |
| 154 | + { |
| 155 | + return Service::getUniqueKey($element, $nr); |
| 156 | + } |
| 157 | + |
| 158 | + public function getCalculatedFieldValue( |
| 159 | + Fieldcollection\Data\AbstractData|Objectbrick\Data\AbstractData|Concrete $object, |
| 160 | + ?Data\CalculatedValue $data |
| 161 | + ): mixed |
| 162 | + { |
| 163 | + return Service::getCalculatedFieldValue($object, $data); |
| 164 | + } |
| 165 | + |
| 166 | + public function getSystemFields(): array |
| 167 | + { |
| 168 | + return Service::getSystemFields(); |
| 169 | + } |
| 170 | + |
| 171 | + public function doResetDirtyMap(Model\AbstractModel $container, ClassDefinition|ClassDefinition\Data $fd): void |
| 172 | + { |
| 173 | + Service::doResetDirtyMap($container, $fd); |
| 174 | + } |
| 175 | + |
| 176 | + public function recursiveResetDirtyMap( |
| 177 | + Model\AbstractModel $container, |
| 178 | + ClassDefinition|ClassDefinition\Data $fd |
| 179 | + ): void |
| 180 | + { |
| 181 | + Service::doResetDirtyMap($container, $fd); |
| 182 | + } |
| 183 | + |
| 184 | + public function getVersionDependentDatabaseColumnName(string $fieldName): string |
| 185 | + { |
| 186 | + return Service::getVersionDependentDatabaseColumnName($fieldName); |
| 187 | + } |
| 188 | + |
| 189 | + public function doHideUnpublished(?ElementInterface $element): bool |
| 190 | + { |
| 191 | + return Service::doHideUnpublished($element); |
| 192 | + } |
| 193 | + |
| 194 | + public function getElementByPath(string $type, string $path): ?ElementInterface |
| 195 | + { |
| 196 | + return Service::getElementByPath($type, $path); |
| 197 | + } |
| 198 | + |
| 199 | + public function getSafeCopyName(string $sourceKey, ElementInterface $target): string |
| 200 | + { |
| 201 | + return Service::getSafeCopyName($sourceKey, $target); |
| 202 | + } |
| 203 | + |
| 204 | + public function getElementById(string $type, int|string $id, array $params = []): Asset|Document|AbstractObject|null |
| 205 | + { |
| 206 | + return Service::getElementById($type, $id, $params); |
| 207 | + } |
| 208 | + |
| 209 | + public function getElementType(ElementInterface $element): ?string |
| 210 | + { |
| 211 | + return Service::getElementType($element); |
| 212 | + } |
| 213 | + |
| 214 | + public function getValidKey(string $key, string $type): string |
| 215 | + { |
| 216 | + return Service::getValidKey($key, $type); |
| 217 | + } |
| 218 | + |
| 219 | + public function isValidKey(string $key, string $type): bool |
| 220 | + { |
| 221 | + return Service::isValidKey($key, $type); |
| 222 | + } |
| 223 | + |
| 224 | + public function isValidPath(string $path, string $type): bool |
| 225 | + { |
| 226 | + return Service::isValidPath($path, $type); |
| 227 | + } |
| 228 | + |
| 229 | + public function cloneMe(ElementInterface $element): ElementInterface |
| 230 | + { |
| 231 | + return Service::cloneMe($element); |
| 232 | + } |
| 233 | + |
| 234 | + public function cloneProperties(mixed $properties): mixed |
| 235 | + { |
| 236 | + return Service::cloneProperties($properties); |
| 237 | + } |
| 238 | + |
| 239 | + public function getElementFromSession( |
| 240 | + string $type, |
| 241 | + int $elementId, |
| 242 | + string $sessionId, |
| 243 | + ?string $postfix = '' |
| 244 | + ): Asset|Document|AbstractObject|null |
| 245 | + { |
| 246 | + return Service::getElementFromSession($type, $elementId, $sessionId, $postfix); |
| 247 | + } |
| 248 | + |
| 249 | + public function locateDaoClass(string $modelClass): ?string |
| 250 | + { |
| 251 | + return Service::locateDaoClass($modelClass); |
| 252 | + } |
| 253 | +} |
0 commit comments