Skip to content

Doctrine Collections

An overview of available infrastructural code when using Doctrine's Collections.

Domain Collection

A Doctrine tailored domain collection is provided by MsgPhp\Domain\Infrastructure\Doctrine\DomainCollection.

Basic Example

<?php

use Doctrine\Common\Collections\ArrayCollection;
use MsgPhp\Domain\Infrastructure\Doctrine\DomainCollection;

// --- SETUP ---

$collection = new DomainCollection(new ArrayCollection([1, 2, 3]));