Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
trash
/
vhost_www.bachtale.com_1719306535
/
htdocs
/
src
/
Entity
/
/srv/data/trash/vhost_www.bachtale.com_1719306535/htdocs/src/Entity/CollectionJewellery.php
<?php namespace App\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\Collection; use Symfony\Component\HttpFoundation\File\File; use Doctrine\Common\Collections\ArrayCollection; use Vich\UploaderBundle\Mapping\Annotation as Vich; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; /** * @ORM\Entity(repositoryClass="App\Repository\CollectionJewelleryRepository") * @Vich\Uploadable * @UniqueEntity( * fields = {"title"}, * message = "La valeur que vous avez indiqué est déjà utilisé !" * ) */ class CollectionJewellery { /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * NOTE: This is not a mapped field of entity metadata, just a simple property. * * @Vich\UploadableField(mapping="slider_images", fileNameProperty="imagesName") * @Assert\Image( * minWidth = 1430, * ) * @Assert\File(mimeTypes = {"image/jpg", "image/jpeg"}) * * @var File */ private $imagesFile; /** * @ORM\Column(type="string", length=255, nullable=true) * * @var string */ private $imagesName; /** * @ORM\Column(type="string", length=255) */ private $title; /** * @ORM\Column(type="text") * @Assert\NotBlank(message="Le champ ne peut pas être vide!") */ private $content; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime") */ private $updatedAt; /** * @ORM\Column(type="boolean") */ private $isActive; /** * @ORM\Column(type="boolean") */ private $position; /** * @ORM\OneToMany(targetEntity="App\Entity\Product", mappedBy="collectionJewellery", cascade={"persist", "remove"}) */ private $products; /** * @ORM\Column(type="boolean") */ private $isHome; /** * @ORM\Column(type="integer") */ private $orderList; public function __construct() { $this->position = true; $this->isActive = true; $this->orderList = 0; $this->createdAt = new \DateTime(); $this->updatedAt = new \DateTime(); $this->products = new ArrayCollection(); } public function __toString() { return $this->getTitle(); } public function getId(): ?int { return $this->id; } public function getTitle(): ?string { return $this->title; } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getContent(): ?string { return $this->content; } public function setContent(string $content): self { $this->content = $content; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getIsActive(): ?bool { return $this->isActive; } public function setIsActive(bool $isActive): self { $this->isActive = $isActive; return $this; } public function getPosition(): ?bool { return $this->position; } public function setPosition(bool $position): self { $this->position = $position; return $this; } /** * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $imagesFile * */ public function setImagesFile(?File $imagesFile = null): void { $this->imagesFile = $imagesFile; if (null !== $imagesFile) { // It is required that at least one field changes if you are using doctrine // otherwise the event listeners won't be called and the file is lost $this->updatedAt = new \DateTimeImmutable(); } } public function getImagesFile(): ?File { return $this->imagesFile; } public function setImagesName(?string $imagesName): void { $this->imagesName = $imagesName; } public function getImagesName(): ?string { return $this->imagesName; } /** * @return Collection|Product[] */ public function getProducts(): Collection { return $this->products; } public function addProduct(Product $product): self { if (!$this->products->contains($product)) { $this->products[] = $product; $product->setCollectionJewellery($this); } return $this; } public function removeProduct(Product $product): self { if ($this->products->contains($product)) { $this->products->removeElement($product); // set the owning side to null (unless already changed) if ($product->getCollectionJewellery() === $this) { $product->setCollectionJewellery(null); } } return $this; } public function getIsHome(): ?bool { return $this->isHome; } public function setIsHome(bool $isHome): self { $this->isHome = $isHome; return $this; } public function getOrderList(): ?int { return $this->orderList; } public function setOrderList(int $orderList): self { $this->orderList = $orderList; return $this; } }