- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\HttpFoundation\File\File;
-
-
- trait ImageTrait
- {
-
-
- protected $image;
-
-
-
- protected $imageFile;
-
- public function setImageFile(File $image = null)
- {
- $this->imageFile = $image;
-
-
-
-
- if ($image) {
-
- $this->updatedAt = new \DateTime('now');
- }
- }
-
- public function getImageFile()
- {
- return $this->imageFile;
- }
-
- public function getImage(): ?string
- {
- return $this->image;
- }
-
- public function setImage(?string $image): self
- {
- $this->image = $image;
-
- return $this;
- }
-
-
- }
|