Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Gitek\SuperlineaBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Validator\Constraints as Assert;
- use Vich\UploaderBundle\Mapping\Annotation as Vich;
- /**
- * Gitek\SuperlineaBundle\Entity\Instruccion
- *
- * @ORM\Table()
- * @ORM\Entity
- * @ORM\HasLifecycleCallbacks
- * @Vich\Uploadable
- */
- class Instruccion
- {
- /**
- * @var integer $id
- *
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var string $nombre
- *
- * @ORM\Column(name="nombre", type="string", length=255)
- */
- private $nombre;
- /**
- * @Assert\File(
- * maxSize="1M",
- * mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
- * )
- * @Vich\UploadableField(mapping="uploads", fileNameProperty="foto", nullable=true)
- *
- * @var File $image
- */
- private $image;
- /**
- * @var string $foto
- *
- * @ORM\Column(name="foto", type="string", length=255, nullable=true)
- */
- private $foto;
- /**
- * @Assert\File(
- * maxSize="2M",
- * mimeTypes={"application/pdf", "application/x-pdf"}
- * )
- * @Vich\UploadableField(mapping="pdfs", fileNameProperty="pdf", nullable=true)
- *
- * @var File $mipdf
- */
- private $mipdf;
- /**
- * @var string $pdf
- *
- * @ORM\Column(name="pdf", type="string", length=255, nullable=true)
- */
- private $pdf;
- /**
- * @var string $video
- *
- * @ORM\Column(name="video", type="string", length=255, nullable=true)
- */
- private $video;
- /**
- * @var \DateTime $created_at
- *
- * @ORM\Column(name="created_at", type="datetime")
- */
- private $created_at;
- /**
- * @var \DateTime $updated_at
- *
- * @ORM\Column(name="updated_at", type="datetime")
- */
- private $updated_at;
- public function setMipdf($mipdf) {
- $this -> mipdf = $mipdf;
- if ($mipdf instanceof UploadedFile) {
- $this->setUpdatedAt(new \DateTime());
- }
- }
- public function getMipdf() {
- return $this -> mipdf;
- }
- public function setImage($image) {
- $this -> image = $image;
- if ($image instanceof UploadedFile) {
- $this->setUpdatedAt(new \DateTime());
- }
- }
- public function getImage() {
- return $this->image;
- }
- public function __construct()
- {
- $this->created_at = new \DateTime();
- $this->updated_at = new \DateTime();
- }
- public function __toString()
- {
- return $this->getNombre();
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set nombre
- *
- * @param string $nombre
- * @return Instruccion
- */
- public function setNombre($nombre)
- {
- $this->nombre = $nombre;
- return $this;
- }
- /**
- * Get nombre
- *
- * @return string
- */
- public function getNombre()
- {
- return $this->nombre;
- }
- /**
- * Set foto
- *
- * @param string $foto
- * @return Instruccion
- */
- public function setFoto($foto)
- {
- $this->foto = $foto;
- return $this;
- }
- /**
- * Get foto
- *
- * @return string
- */
- public function getFoto()
- {
- return $this->foto;
- }
- /**
- * Set video
- *
- * @param string $video
- * @return Instruccion
- */
- public function setVideo($video)
- {
- $this->video = $video;
- return $this;
- }
- /**
- * Get video
- *
- * @return string
- */
- public function getVideo()
- {
- return $this->video;
- }
- /**
- * Set created_at
- *
- * @param \DateTime $createdAt
- * @return Instruccion
- */
- public function setCreatedAt($createdAt)
- {
- $this->created_at = $createdAt;
- return $this;
- }
- /**
- * Get created_at
- *
- * @return \DateTime
- */
- public function getCreatedAt()
- {
- return $this->created_at;
- }
- /**
- * Set updated_at
- *
- * @param \DateTime $updatedAt
- * @return Instruccion
- */
- public function setUpdatedAt($updatedAt)
- {
- $this->updated_at = $updatedAt;
- return $this;
- }
- /**
- * Get updated_at
- *
- * @return \DateTime
- */
- public function getUpdatedAt()
- {
- return $this->updated_at;
- }
- /**
- * Set pdf
- *
- * @param string $pdf
- * @return Instruccion
- */
- public function setPdf($pdf)
- {
- $this->pdf = $pdf;
- return $this;
- }
- /**
- * Get pdf
- *
- * @return string
- */
- public function getPdf()
- {
- return $this->pdf;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement