src/Entity/Product.php line 13
<?php
namespace App\Entity;
use App\Repository\ProductRepository;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ProductRepository::class)]
class Product
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $name;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $titleTag;
#[ORM\Column(type: 'text', nullable: true)]
private $metaDescription;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $slug;
#[ORM\Column(type: 'text', nullable: true)]
private $description;
#[ORM\Column(type: 'float', nullable: true)]
private $price;
#[ORM\Column(type: 'datetime', nullable: true)]
private $created;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isActive;
#[ORM\Column(type: 'boolean', nullable: true)]
private $extractedHome;
#[ORM\ManyToOne(targetEntity: Gallery::class, inversedBy: 'products')]
private $gallery;
#[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'products')]
private $category;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $image;
#[ORM\OneToMany(mappedBy: 'product', targetEntity: Contact::class)]
private $contacts;
#[ORM\Column(length: 255, nullable: true)]
private ?string $descriptionLink = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $pdf = null;
#[ORM\Column(nullable: true)]
private ?bool $mostSold = null;
#[ORM\Column(nullable: true)]
private ?bool $new = null;
#[ORM\OneToMany(mappedBy: 'product', targetEntity: ProductTranslation::class)]
private Collection $productTranslations;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $itemText = null;
#[ORM\Column(length: 20, nullable: true)]
private ?string $type = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $alias = null;
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
private ?int $sequence = null;
#[ORM\Column(nullable: true)]
private ?float $oldPrice = null;
#[ORM\Column(nullable: true)]
private ?bool $showOnlyUser = null;
#[ORM\Column(nullable: true)]
private ?bool $extract = null;
#[ORM\OneToMany(mappedBy: 'product', targetEntity: Orders::class)]
private Collection $orders;
#[ORM\Column(length: 255, nullable: true)]
private ?string $subscriptionType = null;
#[ORM\Column(nullable: true)]
private ?bool $yearlyExtraMonth = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $channelCount = null;
public function __construct(){
$this->created = new DateTime();
$this->contacts = new ArrayCollection();
$this->productTranslations = new ArrayCollection();
$this->orders = new ArrayCollection();
}
public function __toString()
{
return 'Product ' . $this->getId();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getTitleTag(): ?string
{
return $this->titleTag;
}
public function setTitleTag(?string $titleTag): self
{
$this->titleTag = $titleTag;
return $this;
}
public function getMetaDescription(): ?string
{
return $this->metaDescription;
}
public function setMetaDescription(?string $metaDescription): self
{
$this->metaDescription = $metaDescription;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(?float $price): self
{
$this->price = $price;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(?\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function isIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function isExtractedHome(): ?bool
{
return $this->extractedHome;
}
public function setExtractedHome(?bool $extractedHome): self
{
$this->extractedHome = $extractedHome;
return $this;
}
public function getGallery(): ?Gallery
{
return $this->gallery;
}
public function setGallery(?Gallery $gallery): self
{
$this->gallery = $gallery;
return $this;
}
public function getCategory(): ?Category
{
return $this->category;
}
public function setCategory(?Category $category): self
{
$this->category = $category;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
/**
* @return Collection<int, Contact>
*/
public function getContacts(): Collection
{
return $this->contacts;
}
public function addContact(Contact $contact): self
{
if (!$this->contacts->contains($contact)) {
$this->contacts[] = $contact;
$contact->setProduct($this);
}
return $this;
}
public function removeContact(Contact $contact): self
{
if ($this->contacts->removeElement($contact)) {
// set the owning side to null (unless already changed)
if ($contact->getProduct() === $this) {
$contact->setProduct(null);
}
}
return $this;
}
public function getDescriptionLink(): ?string
{
return $this->descriptionLink;
}
public function setDescriptionLink(?string $descriptionLink): self
{
$this->descriptionLink = $descriptionLink;
return $this;
}
public function getPdf(): ?string
{
return $this->pdf;
}
public function setPdf(?string $pdf): self
{
$this->pdf = $pdf;
return $this;
}
public function isMostSold(): ?bool
{
return $this->mostSold;
}
public function setMostSold(?bool $mostSold): self
{
$this->mostSold = $mostSold;
return $this;
}
public function isNew(): ?bool
{
return $this->new;
}
public function setNew(?bool $new): self
{
$this->new = $new;
return $this;
}
/**
* @return Collection<int, ProductTranslation>
*/
public function getProductTranslations(): Collection
{
return $this->productTranslations;
}
public function addProductTranslation(ProductTranslation $productTranslation): self
{
if (!$this->productTranslations->contains($productTranslation)) {
$this->productTranslations->add($productTranslation);
$productTranslation->setProduct($this);
}
return $this;
}
public function removeProductTranslation(ProductTranslation $productTranslation): self
{
if ($this->productTranslations->removeElement($productTranslation)) {
// set the owning side to null (unless already changed)
if ($productTranslation->getProduct() === $this) {
$productTranslation->setProduct(null);
}
}
return $this;
}
public function getItemText(): ?string
{
return $this->itemText;
}
public function setItemText(?string $itemText): self
{
$this->itemText = $itemText;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getAlias(): ?string
{
return $this->alias;
}
public function setAlias(?string $alias): self
{
$this->alias = $alias;
return $this;
}
public function getSequence(): ?int
{
return $this->sequence;
}
public function setSequence(?int $sequence): self
{
$this->sequence = $sequence;
return $this;
}
public function getOldPrice(): ?float
{
return $this->oldPrice;
}
public function setOldPrice(?float $oldPrice): self
{
$this->oldPrice = $oldPrice;
return $this;
}
public function isShowOnlyUser(): ?bool
{
return $this->showOnlyUser;
}
public function setShowOnlyUser(?bool $showOnlyUser): self
{
$this->showOnlyUser = $showOnlyUser;
return $this;
}
public function isExtract(): ?bool
{
return $this->extract;
}
public function setExtract(?bool $extract): self
{
$this->extract = $extract;
return $this;
}
/**
* @return Collection<int, Orders>
*/
public function getOrders(): Collection
{
return $this->orders;
}
public function addOrder(Orders $order): self
{
if (!$this->orders->contains($order)) {
$this->orders->add($order);
$order->setProduct($this);
}
return $this;
}
public function removeOrder(Orders $order): self
{
if ($this->orders->removeElement($order)) {
// set the owning side to null (unless already changed)
if ($order->getProduct() === $this) {
$order->setProduct(null);
}
}
return $this;
}
public function getSubscriptionType(): ?string
{
return $this->subscriptionType;
}
public function setSubscriptionType(?string $subscriptionType): self
{
$this->subscriptionType = $subscriptionType;
return $this;
}
public function isYearlyExtraMonth(): ?bool
{
return $this->yearlyExtraMonth;
}
public function setYearlyExtraMonth(?bool $yearlyExtraMonth): self
{
$this->yearlyExtraMonth = $yearlyExtraMonth;
return $this;
}
public function getChannelCount(): ?string
{
return $this->channelCount;
}
public function setChannelCount(?string $channelCount): self
{
$this->channelCount = $channelCount;
return $this;
}
}