protected function mapSplObjectStorage(array $objectStorageValues = null, $createLazySplObjectStorage = false)
    {
        if ($objectStorageValues === null) {
            return new \SplObjectStorage();
        }

        if ($createLazySplObjectStorage) {
            $objectIdentifiers = [];
            foreach ($objectStorageValues as $arrayValue) {
                if ($arrayValue['value'] !== null) {
                    $objectIdentifiers[] = $arrayValue['value']['identifier'];
                }
            }
            return new LazySplObjectStorage($objectIdentifiers);
        } else {
            $objectStorage = new \SplObjectStorage();

            foreach ($objectStorageValues as $arrayValue) {
                if ($arrayValue['value'] !== null) {
                    $objectStorage->attach($this->mapToObject($arrayValue['value']));
                }
            }
            return $objectStorage;
        }
    }
protected function mapSplObjectStorage(array $objectStorageValues = null, $createLazySplObjectStorage = false)
    {
        if ($objectStorageValues === null) {
            return new \SplObjectStorage();
        }

        if ($createLazySplObjectStorage) {
            $objectIdentifiers = [];
            foreach ($objectStorageValues as $arrayValue) {
                if ($arrayValue['value'] !== null) {
                    $objectIdentifiers[] = $arrayValue['value']['identifier'];
                }
            }
            return new LazySplObjectStorage($objectIdentifiers);
        } else {
            $objectStorage = new \SplObjectStorage();

            foreach ($objectStorageValues as $arrayValue) {
                if ($arrayValue['value'] !== null) {
                    $objectStorage->attach($this->mapToObject($arrayValue['value']));
                }
            }
            return $objectStorage;
        }
    }
protected function mapSplObjectStorage ( array $ objectStorageValues = null , $ createLazySplObjectStorage = false ) { if ( $ objectStorageValues === null ) { return new \ SplObjectStorage ( ) ; } if ( $ createLazySplObjectStorage ) { $ objectIdentifiers = [ ] ; foreach ( $ objectStorageValues as $ arrayValue ) { if ( $ arrayValue [ 'value' ] !== null ) { $ objectIdentifiers [ ] = $ arrayValue [ 'value' ] [ 'identifier' ] ; } } return new LazySplObjectStorage ( $ objectIdentifiers ) ; } else { $ objectStorage = new \ SplObjectStorage ( ) ; foreach ( $ objectStorageValues as $ arrayValue ) { if ( $ arrayValue [ 'value' ] !== null ) { $ objectStorage -> attach ( $ this -> mapToObject ( $ arrayValue [ 'value' ] ) ) ; } } return $ objectStorage ; } }
Maps an SplObjectStorage proxy record back to an SplObjectStorage

@param array $objectStorageValues
@param boolean $createLazySplObjectStorage
@return \SplObjectStorage
@todo restore information attached to objects?
Maps an SplObjectStorage proxy record back to an SplObjectStorage