use Doctrine\Common\Collections\Collection; $collection = new ArrayCollection();
$collection->add('item1'); $collection->add('item2');
$collection->remove('item1');
if ($collection->contains('item2')) { // Do something }Overall, the Collection set provides a convenient way to work with collections of data in PHP. It is part of the Doctrine Common library.