1<?php 2 3declare(strict_types=1); 4 5namespace JMS\Serializer\Tests\Fixtures\DoctrinePHPCR; 6 7use Doctrine\Common\Collections\ArrayCollection; 8use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM; 9 10/** @PHPCRODM\Document */ 11class Comment 12{ 13 /** 14 * @PHPCRODM\Id() 15 */ 16 protected $id; 17 18 /** 19 * @PHPCRODM\ReferenceOne(targetDocument="Author") 20 */ 21 private $author; 22 23 /** @PHPCRODM\ReferenceOne(targetDocument="BlogPost") */ 24 private $blogPost; 25 26 /** 27 * @PHPCRODM\Field(type="string") 28 */ 29 private $text; 30 31 public function __construct(Author $author, $text) 32 { 33 $this->author = $author; 34 $this->text = $text; 35 $this->blogPost = new ArrayCollection(); 36 } 37 38 public function getAuthor() 39 { 40 return $this->author; 41 } 42} 43