<?php
/**
* Created by PhpStorm.
* User: lisavandaele
* Date: 30/01/15
* Time: 12:53
*/
namespace Notaris\AdminBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="AttachmentRepository")
* @ORM\Table(name="attachment",uniqueConstraints={
* @ORM\UniqueConstraint(name="unique_filename", columns={"filename","locale"})})
*/
class Attachment {
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="filename", type="string", length=255)
*/
private $filename;
/**
* @var string
*
* @ORM\Column(name="original_filename", type="string", length=255)
*/
private $originalFilename;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255, nullable=true)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="byte", type="integer")
*/
private $byte;
/**
* @var string
*
* @ORM\Column(name="file_type", type="string", length=255)
*/
private $fileType;
/**
* @var string
*
* @ORM\Column(name="locale", type="string", length=5)
*/
private $locale;
/**
* @ORM\ManyToOne(targetEntity="Notaris\AdminBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="SET NULL")
*/
private $user;
/**
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="created", type="datetime")
*/
protected $created;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set filename
*
* @param string $filename
* @return Attachment
*/
public function setFilename($filename)
{
$this->filename = $filename;
return $this;
}
/**
* Get filename
*
* @return string
*/
public function getFilename()
{
return $this->filename;
}
/**
* Set title
*
* @param string $title
* @return Attachment
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set fileType
*
* @param string $fileType
* @return Attachment
*/
public function setFileType($fileType)
{
$this->fileType = $fileType;
return $this;
}
/**
* Get fileType
*
* @return string
*/
public function getFileType()
{
return $this->fileType;
}
/**
* Set locale
*
* @param string $locale
* @return Attachment
*/
public function setLocale($locale)
{
$this->locale = $locale;
return $this;
}
/**
* Get locale
*
* @return string
*/
public function getLocale()
{
return $this->locale;
}
/**
* Set created
*
* @param \DateTime $created
* @return Attachment
*/
public function setCreated($created)
{
$this->created = $created;
return $this;
}
/**
* Get created
*
* @return \DateTime
*/
public function getCreated()
{
return $this->created;
}
/**
* Set user
*
* @param \Notaris\AdminBundle\Entity\User $user
* @return Attachment
*/
public function setUser(\Notaris\AdminBundle\Entity\User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user
*
* @return \Notaris\AdminBundle\Entity\User
*/
public function getUser()
{
return $this->user;
}
/**
* Set originalFilename
*
* @param string $originalFilename
* @return Attachment
*/
public function setOriginalFilename($originalFilename)
{
$this->originalFilename = $originalFilename;
return $this;
}
/**
* Get originalFilename
*
* @return string
*/
public function getOriginalFilename()
{
return $this->originalFilename;
}
/**
* Set byte
*
* @param integer $byte
* @return Attachment
*/
public function setByte($byte)
{
$this->byte = $byte;
return $this;
}
/**
* Get byte
*
* @return integer
*/
public function getByte()
{
return $this->byte;
}
}