| 1 | <?php |
||
| 13 | class MyEntity |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var int|null |
||
| 17 | * @ORM\Id() |
||
| 18 | * @ORM\Column(type="integer") |
||
| 19 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 20 | */ |
||
| 21 | private $id; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var string |
||
| 25 | * @ORM\Column(type="string") |
||
| 26 | */ |
||
| 27 | private $publicApiField; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var string |
||
| 31 | * @ORM\Column(type="string") |
||
| 32 | */ |
||
| 33 | private $privateField; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var MyEntity |
||
| 37 | * @ORM\ManyToOne(targetEntity="MyEntity", inversedBy="children") |
||
| 38 | */ |
||
| 39 | private $parent; |
||
| 40 | /** |
||
| 41 | * @var ArrayCollection|MyEntity[] |
||
| 42 | * @ORM\OneToMany(targetEntity="MyEntity", mappedBy="parent", orphanRemoval=false) |
||
| 43 | */ |
||
| 44 | private $children; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * MyEntity constructor. |
||
| 48 | * |
||
| 49 | * @param string $privateField |
||
| 50 | */ |
||
| 51 | public function __construct($privateField = 'test') |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return MyEntity |
||
| 61 | */ |
||
| 62 | public function getParent() |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @param MyEntity $parent |
||
| 69 | */ |
||
| 70 | public function setParent(MyEntity $parent = null) |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @return string |
||
| 77 | */ |
||
| 78 | public function getPublicApiField() |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @param string $publicApiField |
||
| 85 | */ |
||
| 86 | public function setPublicApiField($publicApiField) |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @return mixed |
||
| 93 | */ |
||
| 94 | public function getId() |
||
| 98 | } |
||
| 99 |