CircularReferenceParent.php 631 B

123456789101112131415161718192021
  1. <?php
  2. namespace JMS\SerializerBundle\Tests\Fixtures;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. class CircularReferenceParent
  5. {
  6. protected $collection = array();
  7. private $anotherCollection;
  8. public function __construct()
  9. {
  10. $this->collection[] = new CircularReferenceChild('child1', $this);
  11. $this->collection[] = new CircularReferenceChild('child2', $this);
  12. $this->anotherCollection = new ArrayCollection();
  13. $this->anotherCollection->add(new CircularReferenceChild('child1', $this));
  14. $this->anotherCollection->add(new CircularReferenceChild('child2', $this));
  15. }
  16. }