From b42185258c932a1cbb352c1e5587602e12b29dbf Mon Sep 17 00:00:00 2001 From: darkelfe14728 Date: Sun, 26 Jan 2020 19:19:52 +0100 Subject: [PATCH] Create Entities --- src/Entity/Comment.php | 88 +++++ src/Entity/ConfigNotification.php | 72 ++++ src/Entity/Group.php | 120 +++++++ src/Entity/Language.php | 36 ++ src/Entity/Member.php | 67 ++++ src/Entity/Notification.php | 40 +++ src/Entity/Participant.php | 87 +++++ src/Entity/User.php | 340 ++++++++++++++++++ src/Entity/UserNotification.php | 88 +++++ src/Entity/Wish.php | 247 +++++++++++++ src/Repository/CommentRepository.php | 50 +++ .../ConfigNotificationRepository.php | 50 +++ src/Repository/GroupRepository.php | 50 +++ src/Repository/LanguageRepository.php | 50 +++ src/Repository/MemberRepository.php | 50 +++ src/Repository/NotificationRepository.php | 50 +++ src/Repository/ParticipantRepository.php | 50 +++ src/Repository/UserNotificationRepository.php | 50 +++ src/Repository/UserRepository.php | 50 +++ src/Repository/WishRepository.php | 50 +++ 20 files changed, 1685 insertions(+) create mode 100644 src/Entity/Comment.php create mode 100644 src/Entity/ConfigNotification.php create mode 100644 src/Entity/Group.php create mode 100644 src/Entity/Language.php create mode 100644 src/Entity/Member.php create mode 100644 src/Entity/Notification.php create mode 100644 src/Entity/Participant.php create mode 100644 src/Entity/User.php create mode 100644 src/Entity/UserNotification.php create mode 100644 src/Entity/Wish.php create mode 100644 src/Repository/CommentRepository.php create mode 100644 src/Repository/ConfigNotificationRepository.php create mode 100644 src/Repository/GroupRepository.php create mode 100644 src/Repository/LanguageRepository.php create mode 100644 src/Repository/MemberRepository.php create mode 100644 src/Repository/NotificationRepository.php create mode 100644 src/Repository/ParticipantRepository.php create mode 100644 src/Repository/UserNotificationRepository.php create mode 100644 src/Repository/UserRepository.php create mode 100644 src/Repository/WishRepository.php diff --git a/src/Entity/Comment.php b/src/Entity/Comment.php new file mode 100644 index 0000000..399e385 --- /dev/null +++ b/src/Entity/Comment.php @@ -0,0 +1,88 @@ +wish; + } + + public function setWish (?Wish $wish): self { + $this->wish = $wish; + + return $this; + } + + public function getUser (): ?User { + return $this->user; + } + + public function setUser (?User $user): self { + $this->user = $user; + + return $this; + } + + public function getDate (): ?DateTimeInterface { + return $this->date; + } + + public function setDate (DateTimeInterface $date): self { + $this->date = $date; + + return $this; + } + + public function getAnonymous (): ?bool { + return $this->anonymous; + } + + public function setAnonymous (bool $anonymous): self { + $this->anonymous = $anonymous; + + return $this; + } + + public function getContent (): ?string { + return $this->content; + } + + public function setContent (string $content): self { + $this->content = $content; + + return $this; + } +} diff --git a/src/Entity/ConfigNotification.php b/src/Entity/ConfigNotification.php new file mode 100644 index 0000000..5e110b6 --- /dev/null +++ b/src/Entity/ConfigNotification.php @@ -0,0 +1,72 @@ +user; + } + + public function setUser (?User $user): self { + $this->user = $user; + + return $this; + } + + public function getNotif (): ?Notification { + return $this->notif; + } + + public function setNotif (?Notification $notif): self { + $this->notif = $notif; + + return $this; + } + + public function getSite (): ?bool { + return $this->site; + } + + public function setSite (bool $site): self { + $this->site = $site; + + return $this; + } + + public function getEmail (): ?bool { + return $this->email; + } + + public function setEmail (bool $email): self { + $this->email = $email; + + return $this; + } +} diff --git a/src/Entity/Group.php b/src/Entity/Group.php new file mode 100644 index 0000000..3f025fd --- /dev/null +++ b/src/Entity/Group.php @@ -0,0 +1,120 @@ +members = new ArrayCollection(); + $this->wishes = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): self + { + $this->name = $name; + + return $this; + } + + /** + * @return Collection|Member[] + */ + public function getMembers(): Collection + { + return $this->members; + } + + public function addMember(Member $member): self + { + if (!$this->members->contains($member)) { + $this->members[] = $member; + $member->setGroup($this); + } + + return $this; + } + + public function removeMember(Member $member): self + { + if ($this->members->contains($member)) { + $this->members->removeElement($member); + // set the owning side to null (unless already changed) + if ($member->getGroup() === $this) { + $member->setGroup(null); + } + } + + return $this; + } + + /** + * @return Collection|Wish[] + */ + public function getWishes(): Collection + { + return $this->wishes; + } + + public function addWish(Wish $wish): self + { + if (!$this->wishes->contains($wish)) { + $this->wishes[] = $wish; + $wish->setTarget($this); + } + + return $this; + } + + public function removeWish(Wish $wish): self + { + if ($this->wishes->contains($wish)) { + $this->wishes->removeElement($wish); + // set the owning side to null (unless already changed) + if ($wish->getTarget() === $this) { + $wish->setTarget(null); + } + } + + return $this; + } +} diff --git a/src/Entity/Language.php b/src/Entity/Language.php new file mode 100644 index 0000000..b723952 --- /dev/null +++ b/src/Entity/Language.php @@ -0,0 +1,36 @@ +id; + } + + public function getName (): ?string { + return $this->name; + } + + public function setName (string $name): self { + $this->name = $name; + + return $this; + } +} diff --git a/src/Entity/Member.php b/src/Entity/Member.php new file mode 100644 index 0000000..5d41284 --- /dev/null +++ b/src/Entity/Member.php @@ -0,0 +1,67 @@ +id; + } + + public function getGroup (): ?Group { + return $this->group; + } + + public function setGroup (?Group $group): self { + $this->group = $group; + + return $this; + } + + public function getUser (): ?User { + return $this->user; + } + + public function setUser (?User $user): self { + $this->user = $user; + + return $this; + } + + public function getFakeuserName (): ?string { + return $this->fakeuser_name; + } + + public function setFakeuserName (?string $fakeuser_name): self { + $this->fakeuser_name = $fakeuser_name; + + return $this; + } +} diff --git a/src/Entity/Notification.php b/src/Entity/Notification.php new file mode 100644 index 0000000..80af458 --- /dev/null +++ b/src/Entity/Notification.php @@ -0,0 +1,40 @@ +id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): self + { + $this->name = $name; + + return $this; + } +} diff --git a/src/Entity/Participant.php b/src/Entity/Participant.php new file mode 100644 index 0000000..f91f2d6 --- /dev/null +++ b/src/Entity/Participant.php @@ -0,0 +1,87 @@ +wish; + } + + public function setWish (?Wish $wish): self { + $this->wish = $wish; + + return $this; + } + + public function getUser (): ?User { + return $this->user; + } + + public function setUser (?User $user): self { + $this->user = $user; + + return $this; + } + + public function getAnonymous (): ?bool { + return $this->anonymous; + } + + public function setAnonymous (bool $anonymous): self { + $this->anonymous = $anonymous; + + return $this; + } + + public function getPrice (): ?string { + return $this->price; + } + + public function setPrice (?string $price): self { + $this->price = $price; + + return $this; + } + + public function getPaid (): ?bool { + return $this->paid; + } + + public function setPaid (bool $paid): self { + $this->paid = $paid; + + return $this; + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php new file mode 100644 index 0000000..fb3de82 --- /dev/null +++ b/src/Entity/User.php @@ -0,0 +1,340 @@ +friends = new ArrayCollection(); + $this->configNotifications = new ArrayCollection(); + $this->notifications = new ArrayCollection(); + $this->memberOfGroups = new ArrayCollection(); + $this->ownedWishes = new ArrayCollection(); + $this->participations = new ArrayCollection(); + $this->comments = new ArrayCollection(); + } + + public function getId (): ?int { + return $this->id; + } + + public function getEmail (): ?string { + return $this->email; + } + + public function setEmail (string $email): self { + $this->email = $email; + + return $this; + } + + public function getPass (): ?string { + return $this->pass; + } + + public function setPass (string $pass): self { + $this->pass = $pass; + + return $this; + } + + public function getName (): ?string { + return $this->name; + } + + public function setName (string $name): self { + $this->name = $name; + + return $this; + } + + public function getFistname (): ?string { + return $this->fistname; + } + + public function setFistname (?string $fistname): self { + $this->fistname = $fistname; + + return $this; + } + + public function getGender (): ?int { + return $this->gender; + } + + public function setGender (int $gender): self { + $this->gender = $gender; + + return $this; + } + + public function getAvatar (): ?string { + return $this->avatar; + } + + public function setAvatar (?string $avatar): self { + $this->avatar = $avatar; + + return $this; + } + + public function getLanguage (): ?Language { + return $this->language; + } + + public function setLanguage (?Language $language): self { + $this->language = $language; + + return $this; + } + + /** + * @return Collection|self[] + */ + public function getFriends (): Collection { + return $this->friends; + } + + public function addFriend (self $friend): self { + if (!$this->friends->contains($friend)) { + $this->friends[] = $friend; + } + + return $this; + } + + public function removeFriend (self $friend): self { + if ($this->friends->contains($friend)) { + $this->friends->removeElement($friend); + } + + return $this; + } + + /** + * @return Collection|ConfigNotification[] + */ + public function getConfigNotifications (): Collection { + return $this->configNotifications; + } + + public function addConfigNotification (ConfigNotification $configNotification): self { + if (!$this->configNotifications->contains($configNotification)) { + $this->configNotifications[] = $configNotification; + $configNotification->setUser($this); + } + + return $this; + } + + public function removeConfigNotification (ConfigNotification $configNotification): self { + if ($this->configNotifications->contains($configNotification)) { + $this->configNotifications->removeElement($configNotification); + // set the owning side to null (unless already changed) + if ($configNotification->getUser() === $this) { + $configNotification->setUser(null); + } + } + + return $this; + } + + /** + * @return Collection|UserNotification[] + */ + public function getNotifications (): Collection { + return $this->notifications; + } + + public function addNotification (UserNotification $notification): self { + if (!$this->notifications->contains($notification)) { + $this->notifications[] = $notification; + $notification->setUser($this); + } + + return $this; + } + + public function removeNotification (UserNotification $notification): self { + if ($this->notifications->contains($notification)) { + $this->notifications->removeElement($notification); + // set the owning side to null (unless already changed) + if ($notification->getUser() === $this) { + $notification->setUser(null); + } + } + + return $this; + } + + /** + * @return Collection|Wish[] + */ + public function getOwnedWishes(): Collection + { + return $this->ownedWishes; + } + + public function addOwnedWish(Wish $ownedWish): self + { + if (!$this->ownedWishes->contains($ownedWish)) { + $this->ownedWishes[] = $ownedWish; + $ownedWish->setOwner($this); + } + + return $this; + } + + public function removeOwnedWish(Wish $ownedWish): self + { + if ($this->ownedWishes->contains($ownedWish)) { + $this->ownedWishes->removeElement($ownedWish); + // set the owning side to null (unless already changed) + if ($ownedWish->getOwner() === $this) { + $ownedWish->setOwner(null); + } + } + + return $this; + } + + /** + * @return Collection|Participant[] + */ + public function getParticipations(): Collection + { + return $this->participations; + } + + public function addParticipation(Participant $participation): self + { + if (!$this->participations->contains($participation)) { + $this->participations[] = $participation; + $participation->setUser($this); + } + + return $this; + } + + public function removeParticipation(Participant $participation): self + { + if ($this->participations->contains($participation)) { + $this->participations->removeElement($participation); + // set the owning side to null (unless already changed) + if ($participation->getUser() === $this) { + $participation->setUser(null); + } + } + + return $this; + } + + /** + * @return Collection|Comment[] + */ + public function getComments(): Collection + { + return $this->comments; + } + + public function addComment(Comment $comment): self + { + if (!$this->comments->contains($comment)) { + $this->comments[] = $comment; + $comment->setUser($this); + } + + return $this; + } + + public function removeComment(Comment $comment): self + { + if ($this->comments->contains($comment)) { + $this->comments->removeElement($comment); + // set the owning side to null (unless already changed) + if ($comment->getUser() === $this) { + $comment->setUser(null); + } + } + + return $this; + } +} diff --git a/src/Entity/UserNotification.php b/src/Entity/UserNotification.php new file mode 100644 index 0000000..5bb74cc --- /dev/null +++ b/src/Entity/UserNotification.php @@ -0,0 +1,88 @@ +user; + } + + public function setUser (?User $user): self { + $this->user = $user; + + return $this; + } + + public function getNotif (): ?Notification { + return $this->notif; + } + + public function setNotif (?Notification $notif): self { + $this->notif = $notif; + + return $this; + } + + public function getDate (): ?DateTimeInterface { + return $this->date; + } + + public function setDate (DateTimeInterface $date): self { + $this->date = $date; + + return $this; + } + + public function getDescription (): ?string { + return $this->description; + } + + public function setDescription (string $description): self { + $this->description = $description; + + return $this; + } + + public function getSeen (): ?bool { + return $this->seen; + } + + public function setSeen (bool $seen): self { + $this->seen = $seen; + + return $this; + } +} diff --git a/src/Entity/Wish.php b/src/Entity/Wish.php new file mode 100644 index 0000000..259995d --- /dev/null +++ b/src/Entity/Wish.php @@ -0,0 +1,247 @@ +participants = new ArrayCollection(); + $this->comments = new ArrayCollection(); + } + + public function getId (): ?int { + return $this->id; + } + + public function getTarget (): ?Group { + return $this->target; + } + + public function setTarget (?Group $target): self { + $this->target = $target; + + return $this; + } + + public function getOwner (): ?User { + return $this->owner; + } + + public function setOwner (?User $owner): self { + $this->owner = $owner; + + return $this; + } + + public function getDate (): ?DateTimeInterface { + return $this->date; + } + + public function setDate (DateTimeInterface $date): self { + $this->date = $date; + + return $this; + } + + public function getName (): ?string { + return $this->name; + } + + public function setName (string $name): self { + $this->name = $name; + + return $this; + } + + public function getDescription (): ?string { + return $this->description; + } + + public function setDescription (?string $description): self { + $this->description = $description; + + return $this; + } + + public function getVisible (): ?bool { + return $this->visible; + } + + public function setVisible (bool $visible): self { + $this->visible = $visible; + + return $this; + } + + public function getPriceEstimated (): ?string { + return $this->price_estimated; + } + + public function setPriceEstimated (?string $price_estimated): self { + $this->price_estimated = $price_estimated; + + return $this; + } + + public function getPriceReal (): ?string { + return $this->price_real; + } + + public function setPriceReal (?string $price_real): self { + $this->price_real = $price_real; + + return $this; + } + + public function getCrowdfunding (): ?bool { + return $this->crowdfunding; + } + + public function setCrowdfunding (bool $crowdfunding): self { + $this->crowdfunding = $crowdfunding; + + return $this; + } + + public function getFinished (): ?DateTimeInterface { + return $this->finished; + } + + public function setFinished (?DateTimeInterface $finished): self { + $this->finished = $finished; + + return $this; + } + + /** + * @return Collection|Participant[] + */ + public function getParticipants (): Collection { + return $this->participants; + } + + public function addParticipant (Participant $participant): self { + if (!$this->participants->contains($participant)) { + $this->participants[] = $participant; + $participant->setWish($this); + } + + return $this; + } + + public function removeParticipant (Participant $participant): self { + if ($this->participants->contains($participant)) { + $this->participants->removeElement($participant); + // set the owning side to null (unless already changed) + if ($participant->getWish() === $this) { + $participant->setWish(null); + } + } + + return $this; + } + + /** + * @return Collection|Comment[] + */ + public function getComments (): Collection { + return $this->comments; + } + + public function addComment (Comment $comment): self { + if (!$this->comments->contains($comment)) { + $this->comments[] = $comment; + $comment->setWish($this); + } + + return $this; + } + + public function removeComment (Comment $comment): self { + if ($this->comments->contains($comment)) { + $this->comments->removeElement($comment); + // set the owning side to null (unless already changed) + if ($comment->getWish() === $this) { + $comment->setWish(null); + } + } + + return $this; + } +} diff --git a/src/Repository/CommentRepository.php b/src/Repository/CommentRepository.php new file mode 100644 index 0000000..cddf55d --- /dev/null +++ b/src/Repository/CommentRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('c') + ->andWhere('c.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('c.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Comment + { + return $this->createQueryBuilder('c') + ->andWhere('c.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Repository/ConfigNotificationRepository.php b/src/Repository/ConfigNotificationRepository.php new file mode 100644 index 0000000..fff51ad --- /dev/null +++ b/src/Repository/ConfigNotificationRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('c') + ->andWhere('c.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('c.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?ConfigNotification + { + return $this->createQueryBuilder('c') + ->andWhere('c.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Repository/GroupRepository.php b/src/Repository/GroupRepository.php new file mode 100644 index 0000000..6908d15 --- /dev/null +++ b/src/Repository/GroupRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('g') + ->andWhere('g.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('g.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Group + { + return $this->createQueryBuilder('g') + ->andWhere('g.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Repository/LanguageRepository.php b/src/Repository/LanguageRepository.php new file mode 100644 index 0000000..3421b89 --- /dev/null +++ b/src/Repository/LanguageRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('l') + ->andWhere('l.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('l.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Language + { + return $this->createQueryBuilder('l') + ->andWhere('l.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Repository/MemberRepository.php b/src/Repository/MemberRepository.php new file mode 100644 index 0000000..eff92a6 --- /dev/null +++ b/src/Repository/MemberRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('m') + ->andWhere('m.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('m.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Member + { + return $this->createQueryBuilder('m') + ->andWhere('m.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Repository/NotificationRepository.php b/src/Repository/NotificationRepository.php new file mode 100644 index 0000000..b33f189 --- /dev/null +++ b/src/Repository/NotificationRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('n') + ->andWhere('n.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('n.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Notification + { + return $this->createQueryBuilder('n') + ->andWhere('n.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Repository/ParticipantRepository.php b/src/Repository/ParticipantRepository.php new file mode 100644 index 0000000..dd18fb2 --- /dev/null +++ b/src/Repository/ParticipantRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('p') + ->andWhere('p.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('p.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Participant + { + return $this->createQueryBuilder('p') + ->andWhere('p.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Repository/UserNotificationRepository.php b/src/Repository/UserNotificationRepository.php new file mode 100644 index 0000000..175c941 --- /dev/null +++ b/src/Repository/UserNotificationRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('u') + ->andWhere('u.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('u.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?UserNotification + { + return $this->createQueryBuilder('u') + ->andWhere('u.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php new file mode 100644 index 0000000..64f692f --- /dev/null +++ b/src/Repository/UserRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('u') + ->andWhere('u.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('u.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?User + { + return $this->createQueryBuilder('u') + ->andWhere('u.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Repository/WishRepository.php b/src/Repository/WishRepository.php new file mode 100644 index 0000000..d9664fe --- /dev/null +++ b/src/Repository/WishRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('w') + ->andWhere('w.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('w.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Wish + { + return $this->createQueryBuilder('w') + ->andWhere('w.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +}