lib/Persistence/Doctrine/Handler/BlockHandler.php
private function copyBlockCollections(Block $block, Block $targetBlock): void
    {
        $collectionReferences = $this->loadCollectionReferences($block);

        foreach ($collectionReferences as $collectionReference) {
            $collection = $this->collectionHandler->loadCollection(
                $collectionReference->collectionId,
                $collectionReference->collectionStatus
            );

            $collection = $this->collectionHandler->copyCollection($collection);

            $newCollectionReference = CollectionReference::fromArray(
                [
                    'blockId' => $targetBlock->id,
                    'blockStatus' => $targetBlock->status,
                    'collectionId' => $collection->id,
                    'collectionStatus' => $collection->status,
                    'identifier' => $collectionReference->identifier,
                ]
            );

            $this->queryHandler->createCollectionReference($newCollectionReference);
        }
    }
private function copyBlockCollections(Block $block, Block $targetBlock): void
    {
        $collectionReferences = $this->loadCollectionReferences($block);

        foreach ($collectionReferences as $collectionReference) {
            $collection = $this->collectionHandler->loadCollection(
                $collectionReference->collectionId,
                $collectionReference->collectionStatus
            );

            $collection = $this->collectionHandler->copyCollection($collection);

            $newCollectionReference = CollectionReference::fromArray(
                [
                    'blockId' => $targetBlock->id,
                    'blockStatus' => $targetBlock->status,
                    'collectionId' => $collection->id,
                    'collectionStatus' => $collection->status,
                    'identifier' => $collectionReference->identifier,
                ]
            );

            $this->queryHandler->createCollectionReference($newCollectionReference);
        }
    }
private function copyBlockCollections ( Block $ block , Block $ targetBlock ) : void { $ collectionReferences = $ this -> loadCollectionReferences ( $ block ) ; foreach ( $ collectionReferences as $ collectionReference ) { $ collection = $ this -> collectionHandler -> loadCollection ( $ collectionReference -> collectionId , $ collectionReference -> collectionStatus ) ; $ collection = $ this -> collectionHandler -> copyCollection ( $ collection ) ; $ newCollectionReference = CollectionReference :: fromArray ( [ 'blockId' => $ targetBlock -> id , 'blockStatus' => $ targetBlock -> status , 'collectionId' => $ collection -> id , 'collectionStatus' => $ collection -> status , 'identifier' => $ collectionReference -> identifier , ] ) ; $ this -> queryHandler -> createCollectionReference ( $ newCollectionReference ) ; } }
Copies all block collections to another block.
Copies all block collections to another block .