Advertisement
Guest User

Instruccion.php

a guest
Oct 10th, 2012
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.98 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Gitek\SuperlineaBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8.  
  9.  
  10. /**
  11.  * Gitek\SuperlineaBundle\Entity\Instruccion
  12.  *
  13.  * @ORM\Table()
  14.  * @ORM\Entity
  15.  * @ORM\HasLifecycleCallbacks
  16.  * @Vich\Uploadable
  17.  */
  18. class Instruccion
  19. {
  20.     /**
  21.      * @var integer $id
  22.      *
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.  
  29.     /**
  30.      * @var string $nombre
  31.      *
  32.      * @ORM\Column(name="nombre", type="string", length=255)
  33.      */
  34.     private $nombre;
  35.  
  36.     /**
  37.      * @Assert\File(
  38.      *     maxSize="1M",
  39.      *     mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}
  40.      * )
  41.      * @Vich\UploadableField(mapping="uploads", fileNameProperty="foto", nullable=true)
  42.      *
  43.      * @var File $image
  44.      */
  45.     private $image;
  46.  
  47.     /**
  48.      * @var string $foto
  49.      *
  50.      * @ORM\Column(name="foto", type="string", length=255, nullable=true)
  51.      */
  52.     private $foto;
  53.  
  54.     /**
  55.      * @Assert\File(
  56.      *     maxSize="2M",
  57.      *     mimeTypes={"application/pdf", "application/x-pdf"}
  58.      * )
  59.      * @Vich\UploadableField(mapping="pdfs", fileNameProperty="pdf", nullable=true)
  60.      *
  61.      * @var File $mipdf
  62.      */
  63.     private $mipdf;
  64.  
  65.     /**
  66.      * @var string $pdf
  67.      *
  68.      * @ORM\Column(name="pdf", type="string", length=255, nullable=true)
  69.      */
  70.     private $pdf;
  71.  
  72.     /**
  73.      * @var string $video
  74.      *
  75.      * @ORM\Column(name="video", type="string", length=255, nullable=true)
  76.      */
  77.     private $video;
  78.  
  79.     /**
  80.      * @var \DateTime $created_at
  81.      *
  82.      * @ORM\Column(name="created_at", type="datetime")
  83.      */
  84.     private $created_at;
  85.  
  86.     /**
  87.      * @var \DateTime $updated_at
  88.      *
  89.      * @ORM\Column(name="updated_at", type="datetime")
  90.      */
  91.     private $updated_at;
  92.  
  93.     public function setMipdf($mipdf) {
  94.         $this -> mipdf = $mipdf;
  95.         if ($mipdf instanceof UploadedFile) {
  96.             $this->setUpdatedAt(new \DateTime());
  97.         }
  98.     }
  99.  
  100.     public function getMipdf() {
  101.         return $this -> mipdf;
  102.     }
  103.  
  104.     public function setImage($image) {
  105.         $this -> image = $image;
  106.         if ($image instanceof UploadedFile) {
  107.             $this->setUpdatedAt(new \DateTime());
  108.         }
  109.     }
  110.  
  111.     public function getImage() {
  112.         return $this->image;
  113.     }
  114.  
  115.     public function __construct()
  116.     {
  117.         $this->created_at = new \DateTime();
  118.         $this->updated_at = new \DateTime();
  119.     }
  120.  
  121.     public function __toString()
  122.     {
  123.         return $this->getNombre();
  124.     }
  125.  
  126.  
  127.     /**
  128.      * Get id
  129.      *
  130.      * @return integer
  131.      */
  132.     public function getId()
  133.     {
  134.         return $this->id;
  135.     }
  136.  
  137.     /**
  138.      * Set nombre
  139.      *
  140.      * @param string $nombre
  141.      * @return Instruccion
  142.      */
  143.     public function setNombre($nombre)
  144.     {
  145.         $this->nombre = $nombre;
  146.  
  147.         return $this;
  148.     }
  149.  
  150.     /**
  151.      * Get nombre
  152.      *
  153.      * @return string
  154.      */
  155.     public function getNombre()
  156.     {
  157.         return $this->nombre;
  158.     }
  159.  
  160.     /**
  161.      * Set foto
  162.      *
  163.      * @param string $foto
  164.      * @return Instruccion
  165.      */
  166.     public function setFoto($foto)
  167.     {
  168.         $this->foto = $foto;
  169.  
  170.         return $this;
  171.     }
  172.  
  173.     /**
  174.      * Get foto
  175.      *
  176.      * @return string
  177.      */
  178.     public function getFoto()
  179.     {
  180.         return $this->foto;
  181.     }
  182.  
  183.     /**
  184.      * Set video
  185.      *
  186.      * @param string $video
  187.      * @return Instruccion
  188.      */
  189.     public function setVideo($video)
  190.     {
  191.         $this->video = $video;
  192.  
  193.         return $this;
  194.     }
  195.  
  196.     /**
  197.      * Get video
  198.      *
  199.      * @return string
  200.      */
  201.     public function getVideo()
  202.     {
  203.         return $this->video;
  204.     }
  205.  
  206.     /**
  207.      * Set created_at
  208.      *
  209.      * @param \DateTime $createdAt
  210.      * @return Instruccion
  211.      */
  212.     public function setCreatedAt($createdAt)
  213.     {
  214.         $this->created_at = $createdAt;
  215.  
  216.         return $this;
  217.     }
  218.  
  219.     /**
  220.      * Get created_at
  221.      *
  222.      * @return \DateTime
  223.      */
  224.     public function getCreatedAt()
  225.     {
  226.         return $this->created_at;
  227.     }
  228.  
  229.     /**
  230.      * Set updated_at
  231.      *
  232.      * @param \DateTime $updatedAt
  233.      * @return Instruccion
  234.      */
  235.     public function setUpdatedAt($updatedAt)
  236.     {
  237.         $this->updated_at = $updatedAt;
  238.  
  239.         return $this;
  240.     }
  241.  
  242.     /**
  243.      * Get updated_at
  244.      *
  245.      * @return \DateTime
  246.      */
  247.     public function getUpdatedAt()
  248.     {
  249.         return $this->updated_at;
  250.     }
  251.  
  252.     /**
  253.      * Set pdf
  254.      *
  255.      * @param string $pdf
  256.      * @return Instruccion
  257.      */
  258.     public function setPdf($pdf)
  259.     {
  260.         $this->pdf = $pdf;
  261.  
  262.         return $this;
  263.     }
  264.  
  265.     /**
  266.      * Get pdf
  267.      *
  268.      * @return string
  269.      */
  270.     public function getPdf()
  271.     {
  272.         return $this->pdf;
  273.     }
  274. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement