Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 24 |
|
0.00% |
0 / 16 |
CRAP | |
0.00% |
0 / 1 |
| Projects | |
0.00% |
0 / 24 |
|
0.00% |
0 / 16 |
306 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| __toString | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setName | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getDescription | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setDescription | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getURL | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setURL | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getCreatedAt | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setCreatedAt | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getTeaserImage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setTeaserImage | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getDeveloper | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| addDeveloper | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| removeDeveloper | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Entity; |
| 4 | |
| 5 | use App\Repository\ProjectsRepository; |
| 6 | use Doctrine\Common\Collections\ArrayCollection; |
| 7 | use Doctrine\Common\Collections\Collection; |
| 8 | use Doctrine\ORM\Mapping as ORM; |
| 9 | use Stringable; |
| 10 | |
| 11 | #[ORM\Entity(repositoryClass: ProjectsRepository::class)] |
| 12 | class Projects implements Stringable |
| 13 | { |
| 14 | #[ORM\Id] |
| 15 | #[ORM\GeneratedValue] |
| 16 | #[ORM\Column(type: 'integer')] |
| 17 | private ?int $id = null; |
| 18 | |
| 19 | #[ORM\Column(type: 'string', length: 255)] |
| 20 | private ?string $name = null; |
| 21 | |
| 22 | #[ORM\Column(type: 'string', length: 255)] |
| 23 | private ?string $description = null; |
| 24 | |
| 25 | #[ORM\Column(type: 'string', length: 255)] |
| 26 | private ?string $url = null; |
| 27 | |
| 28 | #[ORM\Column(type: 'datetime_immutable')] |
| 29 | private ?\DateTimeImmutable $createdAt = null; |
| 30 | |
| 31 | #[ORM\Column(type: 'string', length: 255, nullable: true)] |
| 32 | private ?string $teaserImage = null; |
| 33 | |
| 34 | #[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'projects')] |
| 35 | private Collection $developer; |
| 36 | |
| 37 | public function __construct() |
| 38 | { |
| 39 | $this->developer = new ArrayCollection(); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * @return string|null |
| 44 | */ |
| 45 | public function __toString(): string |
| 46 | { |
| 47 | return (string) $this->name; |
| 48 | } |
| 49 | |
| 50 | public function getId(): ?int |
| 51 | { |
| 52 | return $this->id; |
| 53 | } |
| 54 | |
| 55 | public function getName(): ?string |
| 56 | { |
| 57 | return $this->name; |
| 58 | } |
| 59 | |
| 60 | public function setName(string $Name): self |
| 61 | { |
| 62 | $this->name = $Name; |
| 63 | |
| 64 | return $this; |
| 65 | } |
| 66 | |
| 67 | public function getDescription(): ?string |
| 68 | { |
| 69 | return $this->description; |
| 70 | } |
| 71 | |
| 72 | public function setDescription(string $Description): self |
| 73 | { |
| 74 | $this->description = $Description; |
| 75 | |
| 76 | return $this; |
| 77 | } |
| 78 | |
| 79 | public function getURL(): ?string |
| 80 | { |
| 81 | return $this->url; |
| 82 | } |
| 83 | |
| 84 | public function setURL(string $url): self |
| 85 | { |
| 86 | $this->url = $url; |
| 87 | |
| 88 | return $this; |
| 89 | } |
| 90 | |
| 91 | public function getCreatedAt(): ?\DateTimeImmutable |
| 92 | { |
| 93 | return $this->createdAt; |
| 94 | } |
| 95 | |
| 96 | public function setCreatedAt(\DateTimeImmutable $createdAt): self |
| 97 | { |
| 98 | $this->createdAt = $createdAt; |
| 99 | |
| 100 | return $this; |
| 101 | } |
| 102 | |
| 103 | public function getTeaserImage(): ?string |
| 104 | { |
| 105 | return $this->teaserImage; |
| 106 | } |
| 107 | |
| 108 | public function setTeaserImage(?string $teaserImage): self |
| 109 | { |
| 110 | $this->teaserImage = $teaserImage; |
| 111 | |
| 112 | return $this; |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * @return Collection<int, User> |
| 117 | */ |
| 118 | public function getDeveloper(): Collection |
| 119 | { |
| 120 | return $this->developer; |
| 121 | } |
| 122 | |
| 123 | public function addDeveloper(User $developer): self |
| 124 | { |
| 125 | if (!$this->developer->contains($developer)) { |
| 126 | $this->developer[] = $developer; |
| 127 | } |
| 128 | |
| 129 | return $this; |
| 130 | } |
| 131 | |
| 132 | public function removeDeveloper(User $developer): self |
| 133 | { |
| 134 | $this->developer->removeElement($developer); |
| 135 | |
| 136 | return $this; |
| 137 | } |
| 138 | } |