Permalink
Fetching contributors…
Cannot retrieve contributors at this time
155 lines (129 sloc) 2.51 KB
<?php
namespace Iphp\FileStoreBundle\Tests\Functional\TestBundle\Entity;
use Iphp\FileStoreBundle\Mapping\Annotation as FileStore;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name = "photo")
* @FileStore\Uploadable
*/
class Photo
{
/**
* @var integer
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string")
* @var string
*/
private $title;
/**
* @var \Datetime
* @ORM\Column(type="datetime")
*/
private $date;
/**
* @ORM\Column(type="array")
* @Assert\Image( maxSize="20M")
* @FileStore\UploadableField(mapping="photo")
**/
private $photo;
/**
* Only for upload
* @Assert\Image( maxSize="20M")
* @FileStore\UploadableField(mapping="photo", fileDataProperty="photoInfo")
**/
private $photoUpload;
/**
* Only for store file info in db
* @ORM\Column(type="array")
**/
private $photoInfo;
/**
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @param string $title
* @return Photo
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* @param array $photo
* @return Photo
*/
public function setPhoto($photo)
{
$this->photo = $photo;
return $this;
}
/**
* @return array
*/
public function getPhoto()
{
return $this->photo;
}
/**
* @param \Datetime $date
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}
/**
* @return \Datetime
*/
public function getDate()
{
return $this->date;
}
/**
* @return mixed
*/
public function getPhotoUpload()
{
return $this->photoUpload;
}
/**
* @param mixed $photoUpload
*/
public function setPhotoUpload($photoUpload)
{
$this->photoUpload = $photoUpload;
}
/**
* @return mixed
*/
public function getPhotoInfo()
{
return $this->photoInfo;
}
/**
* @param mixed $photoInfo
*/
public function setPhotoInfo($photoInfo)
{
$this->photoInfo = $photoInfo;
}
}