Feature #70014
closedRemove hardcoded ObjectStorage creation in ObjectStorageConverter
0%
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.
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.
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".
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.