From 82700e2dc5748ed3a880399624350742fd682865 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Tue, 2 Jul 2024 19:24:48 -0400 Subject: [PATCH] Add NoteShares --- src/Entity/NoteShares.php | 106 ++++++++++++++++++++++++ src/Repository/NoteSharesRepository.php | 43 ++++++++++ 2 files changed, 149 insertions(+) create mode 100644 src/Entity/NoteShares.php create mode 100644 src/Repository/NoteSharesRepository.php diff --git a/src/Entity/NoteShares.php b/src/Entity/NoteShares.php new file mode 100644 index 0000000..f68b7da --- /dev/null +++ b/src/Entity/NoteShares.php @@ -0,0 +1,106 @@ +id; + } + + /** + * Retrieves the owner of the object. + * + * @return User|null The owner of the object, or null if not set. + */ + public function getOwner(): ?User + { + return $this->owner; + } + + /** + * A description of the entire PHP function. + * + * @param User|null $owner description + * @return static + */ + public function setOwner(?User $owner): static + { + $this->owner = $owner; + + return $this; + } + + /** + * Retrieves the share for the current instance. + * + * @return User|null The user who shares this instance. + */ + public function getShare(): ?User + { + return $this->share; + } + + /** + * Set the share for the current instance. + * + * @param User|null $share The user to set as the share. + * @return static The current instance. + */ + public function setShare(?User $share): static + { + $this->share = $share; + + return $this; + } + + /** + * Retrieves the associated Note object. + * + * @return Note|null The associated Note object, or null if not found. + */ + public function getNote(): ?Note + { + return $this->note; + } + + /** + * Set the note for this NoteShares entity. + * + * @param Note|null $note The note to set + * @return static + */ + public function setNote(?Note $note): static + { + $this->note = $note; + + return $this; + } +} diff --git a/src/Repository/NoteSharesRepository.php b/src/Repository/NoteSharesRepository.php new file mode 100644 index 0000000..4ccb99e --- /dev/null +++ b/src/Repository/NoteSharesRepository.php @@ -0,0 +1,43 @@ + + */ +class NoteSharesRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, NoteShares::class); + } + +// /** +// * @return NoteShares[] Returns an array of NoteShares objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('n.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?NoteShares +// { +// return $this->createQueryBuilder('n') +// ->andWhere('n.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +}