lib/Persistence/Doctrine/Mapper/CollectionMapper.php
public function mapCollections(array $data): array
    {
        $collections = [];

        foreach ($data as $dataItem) {
            $collectionId = (int) $dataItem['id'];
            $locale = $dataItem['locale'];

            if (!isset($collections[$collectionId])) {
                $collections[$collectionId] = [
                    'id' => $collectionId,
                    'status' => (int) $dataItem['status'],
                    'offset' => (int) $dataItem['start'],
                    'limit' => $dataItem['length'] !== null ? (int) $dataItem['length'] : null,
                    'isTranslatable' => (bool) $dataItem['translatable'],
                    'mainLocale' => $dataItem['main_locale'],
                    'alwaysAvailable' => (bool) $dataItem['always_available'],
                ];
            }

            $collections[$collectionId]['availableLocales'][] = $locale;
        }

        return array_values(
            array_map(
                static function (array $collectionData): Collection {
                    sort($collectionData['availableLocales']);

                    return Collection::fromArray($collectionData);
                },
                $collections
            )
        );
    }
public function mapCollections(array $data): array
    {
        $collections = [];

        foreach ($data as $dataItem) {
            $collectionId = (int) $dataItem['id'];
            $locale = $dataItem['locale'];

            if (!isset($collections[$collectionId])) {
                $collections[$collectionId] = [
                    'id' => $collectionId,
                    'status' => (int) $dataItem['status'],
                    'offset' => (int) $dataItem['start'],
                    'limit' => $dataItem['length'] !== null ? (int) $dataItem['length'] : null,
                    'isTranslatable' => (bool) $dataItem['translatable'],
                    'mainLocale' => $dataItem['main_locale'],
                    'alwaysAvailable' => (bool) $dataItem['always_available'],
                ];
            }

            $collections[$collectionId]['availableLocales'][] = $locale;
        }

        return array_values(
            array_map(
                static function (array $collectionData): Collection {
                    sort($collectionData['availableLocales']);

                    return Collection::fromArray($collectionData);
                },
                $collections
            )
        );
    }
public function mapCollections ( array $ data ) : array { $ collections = [ ] ; foreach ( $ data as $ dataItem ) { $ collectionId = ( int ) $ dataItem [ 'id' ] ; $ locale = $ dataItem [ 'locale' ] ; if ( ! isset ( $ collections [ $ collectionId ] ) ) { $ collections [ $ collectionId ] = [ 'id' => $ collectionId , 'status' => ( int ) $ dataItem [ 'status' ] , 'offset' => ( int ) $ dataItem [ 'start' ] , 'limit' => $ dataItem [ 'length' ] !== null ? ( int ) $ dataItem [ 'length' ] : null , 'isTranslatable' => ( bool ) $ dataItem [ 'translatable' ] , 'mainLocale' => $ dataItem [ 'main_locale' ] , 'alwaysAvailable' => ( bool ) $ dataItem [ 'always_available' ] , ] ; } $ collections [ $ collectionId ] [ 'availableLocales' ] [ ] = $ locale ; } return array_values ( array_map ( static function ( array $ collectionData ) : Collection { sort ( $ collectionData [ 'availableLocales' ] ) ; return Collection :: fromArray ( $ collectionData ) ; } , $ collections ) ) ; }
Maps data from database to collection values.

@return \Netgen\BlockManager\Persistence\Values\Collection\Collection[]
Maps data from database to collection values .