src/Entity/MarketCategory.php line 26
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\Get;use ApiPlatform\Metadata\GetCollection;use App\Entity\Traits\CreatedAtTrait;use App\Entity\Traits\UpdatedAtTrait;use App\Repository\MarketCategoryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\HasLifecycleCallbacks]#[ORM\Entity(repositoryClass: MarketCategoryRepository::class)]#[ApiResource(operations: [new Get(),new GetCollection(),],normalizationContext: ['groups' => 'MarketCategory:read'],paginationEnabled: false)]class MarketCategory{use CreatedAtTrait;use UpdatedAtTrait;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['read', 'MarketCategory:read'])]private ?int $id = null;#[ORM\Column(length: 255)]#[Groups(['read', 'MarketCategory:read'])]private ?string $name = null;#[ORM\ManyToMany(targetEntity: MarketApp::class, inversedBy: 'marketCategories')]#[Groups(['MarketCategory:read'])]private Collection $apps;public function __construct(){$this->apps = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function __toString(): string{return $this->getName();}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}/*** @return Collection<int, MarketApp>*/public function getApps(): Collection{return $this->apps;}public function addApp(MarketApp $app): self{if (!$this->apps->contains($app)) {$this->apps->add($app);}return $this;}public function removeApp(MarketApp $app): self{$this->apps->removeElement($app);return $this;}}