This commit is contained in:
Tykayn 2025-02-14 15:35:03 +01:00 committed by tykayn
parent d8c1b7c0f6
commit d01ecdabba
13 changed files with 198 additions and 25 deletions

View file

@ -3,12 +3,17 @@
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\ApiProperty;
use App\Repository\ProductRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use App\Filter\UserProductsFilter;
use App\DTO\UserDTO;
#[ApiResource(paginationEnabled: false)]
#[UserProductsFilter]
#[ORM\Entity(repositoryClass: ProductRepository::class)]
class Product
{
@ -30,12 +35,14 @@ class Product
* @var Collection<int, GroupOfProducts>
*/
#[ORM\ManyToMany(targetEntity: GroupOfProducts::class, mappedBy: 'products')]
#[ApiProperty(readable: false)]
private Collection $groupOfProducts;
/**
* @var Collection<int, Selling>
*/
#[ORM\ManyToMany(targetEntity: Selling::class, mappedBy: 'products')]
#[ApiProperty(readable: false)]
private Collection $sellings;
#[ORM\ManyToOne(inversedBy: 'products')]