src/Notaris/AdminBundle/Entity/Attachment.php line 19

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: lisavandaele
  5.  * Date: 30/01/15
  6.  * Time: 12:53
  7.  */
  8. namespace Notaris\AdminBundle\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Gedmo\Mapping\Annotation as Gedmo;
  11. /**
  12.  * @ORM\Entity(repositoryClass="AttachmentRepository")
  13.  * @ORM\Table(name="attachment",uniqueConstraints={
  14.  *     @ORM\UniqueConstraint(name="unique_filename", columns={"filename","locale"})})
  15.  */
  16. class Attachment {
  17.     /**
  18.      * @var integer
  19.      *
  20.      * @ORM\Column(name="id", type="integer")
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @var string
  27.      *
  28.      * @ORM\Column(name="filename", type="string", length=255)
  29.      */
  30.     private $filename;
  31.     /**
  32.      * @var string
  33.      *
  34.      * @ORM\Column(name="original_filename", type="string", length=255)
  35.      */
  36.     private $originalFilename;
  37.     /**
  38.      * @var string
  39.      *
  40.      * @ORM\Column(name="title", type="string", length=255, nullable=true)
  41.      */
  42.     private $title;
  43.     /**
  44.      * @var string
  45.      *
  46.      * @ORM\Column(name="byte", type="integer")
  47.      */
  48.     private $byte;
  49.     /**
  50.      * @var string
  51.      *
  52.      * @ORM\Column(name="file_type", type="string", length=255)
  53.      */
  54.     private $fileType;
  55.     /**
  56.      * @var string
  57.      *
  58.      * @ORM\Column(name="locale", type="string", length=5)
  59.      */
  60.     private $locale;
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity="Notaris\AdminBundle\Entity\User")
  63.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="SET NULL")
  64.      */
  65.     private $user;
  66.     /**
  67.      * @Gedmo\Timestampable(on="create")
  68.      * @ORM\Column(name="created", type="datetime")
  69.      */
  70.     protected $created;
  71.     /**
  72.      * Get id
  73.      *
  74.      * @return integer 
  75.      */
  76.     public function getId()
  77.     {
  78.         return $this->id;
  79.     }
  80.     /**
  81.      * Set filename
  82.      *
  83.      * @param string $filename
  84.      * @return Attachment
  85.      */
  86.     public function setFilename($filename)
  87.     {
  88.         $this->filename = $filename;
  89.         return $this;
  90.     }
  91.     /**
  92.      * Get filename
  93.      *
  94.      * @return string 
  95.      */
  96.     public function getFilename()
  97.     {
  98.         return $this->filename;
  99.     }
  100.     /**
  101.      * Set title
  102.      *
  103.      * @param string $title
  104.      * @return Attachment
  105.      */
  106.     public function setTitle($title)
  107.     {
  108.         $this->title = $title;
  109.         return $this;
  110.     }
  111.     /**
  112.      * Get title
  113.      *
  114.      * @return string 
  115.      */
  116.     public function getTitle()
  117.     {
  118.         return $this->title;
  119.     }
  120.     /**
  121.      * Set fileType
  122.      *
  123.      * @param string $fileType
  124.      * @return Attachment
  125.      */
  126.     public function setFileType($fileType)
  127.     {
  128.         $this->fileType = $fileType;
  129.         return $this;
  130.     }
  131.     /**
  132.      * Get fileType
  133.      *
  134.      * @return string 
  135.      */
  136.     public function getFileType()
  137.     {
  138.         return $this->fileType;
  139.     }
  140.     /**
  141.      * Set locale
  142.      *
  143.      * @param string $locale
  144.      * @return Attachment
  145.      */
  146.     public function setLocale($locale)
  147.     {
  148.         $this->locale = $locale;
  149.         return $this;
  150.     }
  151.     /**
  152.      * Get locale
  153.      *
  154.      * @return string 
  155.      */
  156.     public function getLocale()
  157.     {
  158.         return $this->locale;
  159.     }
  160.     /**
  161.      * Set created
  162.      *
  163.      * @param \DateTime $created
  164.      * @return Attachment
  165.      */
  166.     public function setCreated($created)
  167.     {
  168.         $this->created = $created;
  169.         return $this;
  170.     }
  171.     /**
  172.      * Get created
  173.      *
  174.      * @return \DateTime 
  175.      */
  176.     public function getCreated()
  177.     {
  178.         return $this->created;
  179.     }
  180.     /**
  181.      * Set user
  182.      *
  183.      * @param \Notaris\AdminBundle\Entity\User $user
  184.      * @return Attachment
  185.      */
  186.     public function setUser(\Notaris\AdminBundle\Entity\User $user = null)
  187.     {
  188.         $this->user = $user;
  189.         return $this;
  190.     }
  191.     /**
  192.      * Get user
  193.      *
  194.      * @return \Notaris\AdminBundle\Entity\User 
  195.      */
  196.     public function getUser()
  197.     {
  198.         return $this->user;
  199.     }
  200.     /**
  201.      * Set originalFilename
  202.      *
  203.      * @param string $originalFilename
  204.      * @return Attachment
  205.      */
  206.     public function setOriginalFilename($originalFilename)
  207.     {
  208.         $this->originalFilename = $originalFilename;
  209.         return $this;
  210.     }
  211.     /**
  212.      * Get originalFilename
  213.      *
  214.      * @return string 
  215.      */
  216.     public function getOriginalFilename()
  217.     {
  218.         return $this->originalFilename;
  219.     }
  220.     /**
  221.      * Set byte
  222.      *
  223.      * @param integer $byte
  224.      * @return Attachment
  225.      */
  226.     public function setByte($byte)
  227.     {
  228.         $this->byte = $byte;
  229.         return $this;
  230.     }
  231.     /**
  232.      * Get byte
  233.      *
  234.      * @return integer 
  235.      */
  236.     public function getByte()
  237.     {
  238.         return $this->byte;
  239.     }
  240. }