Total Complexity | 7 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | #[ORM\Entity] |
||
16 | #[ORM\Table(name: 'resource_format')] |
||
17 | class ResourceFormat |
||
18 | { |
||
19 | use TimestampableEntity; |
||
20 | |||
21 | #[ORM\Id] |
||
22 | #[ORM\Column(type: 'integer')] |
||
23 | #[ORM\GeneratedValue] |
||
24 | protected ?int $id = null; |
||
25 | |||
26 | #[ORM\Column] |
||
27 | #[Assert\NotBlank] |
||
28 | protected string $title; |
||
29 | |||
30 | /** |
||
31 | * @var Collection<int, ResourceNode> |
||
32 | */ |
||
33 | #[ORM\OneToMany(targetEntity: ResourceNode::class, mappedBy: 'resourceFormat', cascade: ['persist', 'remove'])] |
||
34 | protected Collection $resourceNodes; |
||
35 | |||
36 | public function __construct() |
||
37 | { |
||
38 | $this->resourceNodes = new ArrayCollection(); |
||
39 | } |
||
40 | |||
41 | public function __toString(): string |
||
42 | { |
||
43 | return $this->title; |
||
44 | } |
||
45 | |||
46 | public function getId(): int |
||
47 | { |
||
48 | return $this->id; |
||
|
|||
49 | } |
||
50 | |||
51 | public function getTitle(): string |
||
52 | { |
||
53 | return $this->title; |
||
54 | } |
||
55 | |||
56 | public function setTitle(string $title): self |
||
57 | { |
||
58 | $this->title = $title; |
||
59 | |||
60 | return $this; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * @return Collection<int, ResourceNode> |
||
65 | */ |
||
66 | public function getResourceNodes(): Collection |
||
69 | } |
||
70 | |||
71 | public function setResourceNodes(Collection $resourceNodes): self |
||
76 | } |
||
77 | } |
||
78 |