|
- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use Doctrine\ORM\Mapping as ORM;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Lc\ShopBundle\Context\SluggableInterface;
- use Lc\ShopBundle\Context\SortableInterface;
- use Lc\ShopBundle\Context\StatusInterface;
- use Symfony\Component\HttpFoundation\File\File;
- use Vich\UploaderBundle\Mapping\Annotation as Vich;
-
- /**
- * @ORM\MappedSuperclass
- * @Vich\Uploadable
- */
- abstract class AbstractDocumentEntity extends AbstractEntity implements StatusInterface, SortableInterface, SluggableInterface
- {
- use SortableTrait;
-
- use StatusTrait;
-
- use SluggableTrait;
-
- /**
- * @ORM\Column(type="string", length=255)
- */
- protected $title;
-
- /**
- * @ORM\Column(type="text", nullable=true)
- */
- protected $description;
-
- /**
- * @ORM\Column(type="string", length=255, nullable=true)
- */
- protected $image;
-
- /**
- * @Vich\UploadableField(mapping="images", fileNameProperty="image")
- * @var File
- */
- protected $imageFile;
-
- /**
- * @ORM\Column(type="string", length=255, nullable=true)
- */
- protected $devAlias;
-
- /**
- * @ORM\Column(type="text", nullable=true)
- */
- protected $metaDescription;
-
- /**
- * @var array
- * @ORM\Column(name="old_url", type="array", nullable=true)
- */
- private $oldUrl;
-
-
- public function setImageFile(File $image = null)
- {
- $this->imageFile = $image;
-
- // VERY IMPORTANT:
- // 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
- if ($image) {
- // if 'updatedAt' is not defined in your entity, use another property
- $this->updatedAt = new \DateTime('now');
- }
- }
-
- public function getImageFile()
- {
- return $this->imageFile;
- }
-
- public function getTitle(): ?string
- {
- return $this->title;
- }
-
- public function setTitle(string $title): self
- {
- $this->title = $title;
-
- return $this;
- }
-
-
- public function getDescription(): ?string
- {
- return $this->description;
- }
-
- public function setDescription(?string $description): self
- {
- $this->description = $description;
-
- return $this;
- }
-
-
- /**
- * Set oldUrl
- *
- * @param array $oldUrl
- *
- * @return AbstractEntity
- */
- public function setOldUrl($oldUrl)
- {
- $this->oldUrl = $oldUrl;
-
- return $this;
- }
-
- /**
- * Get oldUrl
- *
- * @return array
- */
- public function getOldUrl()
- {
- return $this->oldUrl;
- }
-
-
- public function getMetaDescription(): ?string
- {
- return $this->metaDescription;
- }
-
- public function setMetaDescription(?string $metaDescription): self
- {
- $this->metaDescription = $metaDescription;
-
- return $this;
- }
-
- public function getImage(): ?string
- {
- return $this->image;
- }
-
- public function setImage(?string $image): self
- {
- $this->image = $image;
-
- return $this;
- }
-
- public function getDevAlias(): ?string
- {
- return $this->devAlias;
- }
-
- public function setDevAlias(?string $devAlias): self
- {
- $this->devAlias = $devAlias;
-
- return $this;
- }
-
- }
|