Project

General

Profile

Actions

Feature #70014

closed

Remove hardcoded ObjectStorage creation in ObjectStorageConverter

Added by Viktor Livakivskyi about 9 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-09-22
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.6
Tags:
Complexity:
Sprint Focus:

Description

\TYPO3\CMS\Extbase\Property\TypeConverter\ObjectStorageConverter contains hardcoded ObjectStorage creation in convertFrom() method:

public function convertFrom($source, $targetType, array $convertedChildProperties = array(), \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface $configuration = NULL) {
    $objectStorage = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
    ...
}

It makes it impossible to use custom ObjectStorage in model without custom TypeConverter.

It makes sense to parse incoming $targetType with TypeHandlingUtility and in case it is child of ObjectStorage or ObjectStorage itself, instantiate it with ObjectManager.

Actions #1

Updated by Viktor Livakivskyi about 9 years ago

Another issue: in case of custom collection @lazy annotation creates instance of LazyLoadingProxy instead of LazyObjectStorage - this also needs to be handled in a correct manner.

Actions #2

Updated by Viktor Livakivskyi about 9 years ago

Okay, after more playing with this, I realized, that there are even more places, which are broken as soon, as one uses custom collection. These include, but not limited to \TYPO3\CMS\Extbase\Utility\TypeHandlingUtility::isCollectionType() which is used by \TYPO3\CMS\Extbase\Validation\Validator\CollectionValidator.
Maybe other normal and edge cases are also in list.

So, this feature is even more generic and may be renamed to something, like "Allow custom ObjectStorages as part of Domain model".

Actions #3

Updated by Susanne Moog almost 5 years ago

  • Status changed from New to Closed

Due to low demand / low priority I'm going to close this issue now. If anyone takes time to implement it, simply open a new issue please. Thanks.

Actions

Also available in: Atom PDF