src/Entity/Product.php line 44
<?phpnamespace App\Entity;use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;use ApiPlatform\Metadata\ApiFilter;use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\Get;use ApiPlatform\Metadata\GetCollection;use ApiPlatform\Metadata\Patch;use ApiPlatform\Serializer\Filter\PropertyFilter;use App\Repository\ProductRepository;use DateTimeImmutable;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Validator\Constraints as Assert;use function Symfony\Component\String\u;#[ORM\Entity(repositoryClass: ProductRepository::class)]#[ApiFilter(PropertyFilter::class)]#[ApiResource(shortName: 'Produkte',description: 'Wordpress Theme / Plugins',operations: [new Get(uriTemplate: '/product/{id}'),new GetCollection(uriTemplate: '/product', paginationEnabled: false),],formats: ['jsonld','json','jsonhal','html','csv' => 'text/csv',],normalizationContext: ['groups' => ['product:read'],],denormalizationContext: ['groups' => ['product:write'],],)]class Product{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['product:read', 'lizenz:read'])]private ?int $id = null;#[ORM\OneToOne(inversedBy: "product", targetEntity: ProductDashboard::class, cascade: ["persist", "remove"])]#[ORM\JoinColumn(name: "productDashboard", nullable: false)]protected ?ProductDashboard $productDashboard;#[ORM\OneToOne(inversedBy: "product", targetEntity: UpdateChecker::class, cascade: ["persist", "remove"])]#[ORM\JoinColumn(name: "updateChecker", nullable: true)]protected ?UpdateChecker $updateChecker;#[ORM\Column(length: 128)]#[Groups(['product:read'])]#[Assert\NotBlank]#[ApiFilter(SearchFilter::class, strategy: 'partial')]private ?string $bezeichnung = null;#[ORM\Column(length: 255, nullable: true)]#[Groups(['product:read'])]private ?string $beschreibung = null;#[ORM\Column(type: Types::SMALLINT)]#[Groups(['product:read'])]#[Assert\NotBlank]#[ApiFilter(SearchFilter::class, strategy: 'exact')]private ?int $type = null;#[ORM\Column(length: 11)]#[Groups(['product:read', 'lizenz:read'])]#[Assert\NotBlank]private ?string $version = null;#[ORM\Column]#[Groups(['product:read'])]#[Assert\NotBlank]private ?bool $is_git = null;#[ORM\Column(length: 128, nullable: true)]#[Groups(['product:read'])]private ?string $git_url = null;#[ORM\Column(length: 128)]#[Groups(['product:read'])]#[Assert\NotBlank]#[ApiFilter(SearchFilter::class, strategy: 'exact')]private ?string $slug = null;#[ORM\Column]#[Groups(['product:read'])]#[Assert\NotBlank]private ?bool $is_license = null;#[ORM\Column]#[Groups(['product:read'])]#[ApiFilter(SearchFilter::class, strategy: 'exact')]#[Assert\NotBlank]private ?bool $is_show_api = null;#[ORM\Column(length: 255, nullable: true)]//#[Groups(['product:read'])]private ?string $aktivierungs_path = null;#[ORM\Column]#[Groups(['product:read'])]private ?DateTimeImmutable $created_at = null;#[ORM\Column(length: 32, nullable: true)]private ?string $gitVersion = null;#[Groups(['product:read'])]#[ApiFilter(SearchFilter::class, strategy: 'exact')]#[ORM\Column(nullable: true, options: ['default' => false])]private ?bool $is_standalone = null;public function __construct(){$this->created_at = new DateTimeImmutable();}/*** @return ProductDashboard|null*/public function getProductDashboard(): ?ProductDashboard{return $this->productDashboard;}/*** @param ProductDashboard|null $productDashboard*/public function setProductDashboard(?ProductDashboard $productDashboard): void{$this->productDashboard = $productDashboard;}public function getId(): ?int{return $this->id;}public function getBezeichnung(): ?string{return $this->bezeichnung;}public function setBezeichnung(string $bezeichnung): self{$this->bezeichnung = $bezeichnung;return $this;}public function getBeschreibung(): ?string{return $this->beschreibung;}#[Groups(['product:read'])]public function getShortBeschreibung(): ?string{return u($this->getBeschreibung())->truncate(40, '...');}public function setBeschreibung(?string $beschreibung): self{$this->beschreibung = $beschreibung;return $this;}public function getType(): ?int{return $this->type;}public function setType(int $type): self{$this->type = $type;return $this;}public function getVersion(): ?string{return $this->version;}public function setVersion(string $version): self{$this->version = $version;return $this;}public function isIsGit(): ?bool{return $this->is_git;}public function setIsGit(bool $is_git): self{$this->is_git = $is_git;return $this;}public function getGitUrl(): ?string{return $this->git_url;}public function setGitUrl(?string $git_url): self{$this->git_url = $git_url;return $this;}public function getSlug(): ?string{return $this->slug;}public function setSlug(string $slug): self{$this->slug = $slug;return $this;}public function isIsLicense(): ?bool{return $this->is_license;}public function setIsLicense(bool $is_license): self{$this->is_license = $is_license;return $this;}public function isIsShowApi(): ?bool{return $this->is_show_api;}public function setIsShowApi(bool $is_show_api): self{$this->is_show_api = $is_show_api;return $this;}public function getAktivierungsPath(): ?string{return $this->aktivierungs_path;}public function setAktivierungsPath(?string $aktivierungs_path): self{$this->aktivierungs_path = $aktivierungs_path;return $this;}public function getCreatedAt(): ?DateTimeImmutable{return $this->created_at;}public function setCreatedAt(DateTimeImmutable $created_at): self{$this->created_at = $created_at;return $this;}public function getUpdateChecker(): ?UpdateChecker{return $this->updateChecker;}public function setUpdateChecker(?UpdateChecker $updateChecker): self{$this->updateChecker = $updateChecker;return $this;}public function getGitVersion(): ?string{return $this->gitVersion;}public function setGitVersion(?string $gitVersion): self{$this->gitVersion = $gitVersion;return $this;}public function isStandalone(): ?bool{return $this->is_standalone;}public function setIsStandalone(bool $is_standalone): self{$this->is_standalone = $is_standalone;return $this;}}