diff --git a/src/Entity/.gitignore b/src/Entity/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/src/Entity/Helpers/EnabledTrait.php b/src/Entity/Helpers/EnabledTrait.php new file mode 100644 index 0000000..089579f --- /dev/null +++ b/src/Entity/Helpers/EnabledTrait.php @@ -0,0 +1,24 @@ +enabled; + } + + public function setEnabled(bool $enabled) + { + $this->enabled = $enabled; + return $this; + } +} \ No newline at end of file diff --git a/src/Entity/Product.php b/src/Entity/Product.php new file mode 100644 index 0000000..5daba94 --- /dev/null +++ b/src/Entity/Product.php @@ -0,0 +1,53 @@ +id; + } + + 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; + } +} diff --git a/src/Repository/.gitignore b/src/Repository/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/src/Repository/ProductRepository.php b/src/Repository/ProductRepository.php new file mode 100644 index 0000000..c34bb70 --- /dev/null +++ b/src/Repository/ProductRepository.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): ?Product + { + return $this->createQueryBuilder('p') + ->andWhere('p.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +}