public static function arrayToObjectStorage($entity, $array)
    {
        $storage = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage');
        foreach ($array as $item) {
            $storage->attach(EntityUtility::mergeArrayIntoEntity($entity, $item));
        }

        return $storage;
    }
public static function arrayToObjectStorage($entity, $array)
    {
        $storage = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage');
        foreach ($array as $item) {
            $storage->attach(EntityUtility::mergeArrayIntoEntity($entity, $item));
        }

        return $storage;
    }
public static function arrayToObjectStorage ( $ entity , $ array ) { $ storage = GeneralUtility :: makeInstance ( 'TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage' ) ; foreach ( $ array as $ item ) { $ storage -> attach ( EntityUtility :: mergeArrayIntoEntity ( $ entity , $ item ) ) ; } return $ storage ; }
Transforms an array into ObjectStorage

@param $entity
@param $array
@return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
Transforms an array into ObjectStorage