src/Entity/MarketApp.php line 34
<?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\MarketAppRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Types\UlidType;use Symfony\Component\HttpFoundation\File\File;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Uid\Ulid;use Symfony\Component\Uid\Uuid;use Symfony\Component\Validator\Constraints as Assert;use Vich\UploaderBundle\Mapping\Annotation as Vich;#[ORM\HasLifecycleCallbacks]#[Vich\Uploadable]#[ORM\Entity(repositoryClass: MarketAppRepository::class)]#[ApiResource(operations: [new Get(),new GetCollection(),],normalizationContext: ['groups' => 'read'],paginationEnabled: false)]class MarketApp{use CreatedAtTrait;use UpdatedAtTrait;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['read', 'MarketCategory:read'])]private ?int $id = null;#[Vich\UploadableField(mapping: 'icon_file', fileNameProperty: 'icon')]#[Assert\Image(mimeTypes: ['image/png', 'image/jpeg', 'image/jpg'])]private ?File $iconFile = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['read', 'MarketCategory:read'])]private ?string $icon = null;#[ORM\Column(length: 255)]#[Groups(['read', 'MarketCategory:read'])]private ?string $name = null;#[ORM\Column(length: 255)]#[Groups(['read', 'MarketCategory:read'])]private ?string $developer = null;#[ORM\Column(length: 2000)]#[Groups(['read', 'MarketCategory:read'])]private ?string $description = null;#[ORM\Column(length: 500)]#[Groups(['read', 'MarketCategory:read'])]private ?string $shortDescription = null;#[ORM\Column(length: 500)]#[Groups(['read', 'MarketCategory:read'])]private ?string $downloads = null;#[ORM\Column(length: 500)]#[Groups(['read', 'MarketCategory:read'])]private ?string $url = null;#[ORM\OneToMany(mappedBy: 'marketApp', targetEntity: MarketAppImage::class, cascade: ['persist', 'remove'])]#[Groups(['read', 'MarketCategory:read'])]private Collection $images;#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: '0')]#[Groups(['read', 'MarketCategory:read'])]private ?string $price = null;#[ORM\ManyToMany(targetEntity: MarketCategory::class, mappedBy: 'apps')]#[Groups(['read'])]private Collection $marketCategories;public function __construct(){$this->images = new ArrayCollection();$this->marketCategories = new ArrayCollection();}public function __toString(): string{return $this->getName();}public function getId(): ?int{return $this->id;}public function getIconFile(): ?File{return $this->iconFile;}public function setIconFile(?File $iconFile): void{$this->iconFile = $iconFile;if (null !== $iconFile) {$this->updatedAt = new \DateTime();}}public function getIcon(): ?string{return $this->icon;}public function setIcon(?string $icon): self{$this->icon = $icon;return $this;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getImages(): Collection{return $this->images;}public function addImage(MarketAppImage $image): self{if (!$this->images->contains($image)) {$this->images->add($image);$image->setMarketApp($this);}return $this;}public function removeImage(MarketAppImage $image): self{if ($this->images->removeElement($image)) {// set the owning side to null (unless already changed)if ($image->getMarketApp() === $this) {$image->setMarketApp(null);}}return $this;}public function getDeveloper(): ?string{return $this->developer;}public function setDeveloper(string $developer): self{$this->developer = $developer;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(string $description): self{$this->description = $description;return $this;}public function getShortDescription(): ?string{return $this->shortDescription;}public function setShortDescription(string $shortDescription): self{$this->shortDescription = $shortDescription;return $this;}public function getDownloads(): ?string{return $this->downloads;}public function setDownloads(string $downloads): self{$this->downloads = $downloads;return $this;}public function getUrl(): ?string{return $this->url;}public function setUrl(string $url): self{$this->url = $url;return $this;}public function getPrice(): ?string{return $this->price;}public function setPrice(string $price): self{$this->price = $price;return $this;}/*** @return Collection<int, MarketCategory>*/public function getMarketCategories(): Collection{return $this->marketCategories;}public function addMarketCategory(MarketCategory $marketCategory): self{if (!$this->marketCategories->contains($marketCategory)) {$this->marketCategories->add($marketCategory);$marketCategory->addApp($this);}return $this;}public function removeMarketCategory(MarketCategory $marketCategory): self{if ($this->marketCategories->removeElement($marketCategory)) {$marketCategory->removeApp($this);}return $this;}}