Created
December 19, 2012 17:44
-
-
Save ricfrank/4338673 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My\SomethingBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\HttpFoundation\File\File; | |
use Symfony\Component\Validator\Constraints as Assert; | |
use Vich\UploaderBundle\Mapping\Annotation as Vich; | |
/** | |
* My\SomethingBundle\Entity\Banner | |
* | |
* @ORM\Entity(repositoryClass="My\SomethingBundle\Entity\BannerRepository") | |
* @ORM\Entity | |
* @ORM\Table(name="banner") | |
* @Vich\Uploadable | |
*/ | |
class Banner | |
{ | |
const STATUS_OFF = 'off'; | |
/** | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue(strategy="AUTO") | |
*/ | |
protected $id; | |
/** | |
* @ORM\Column(type="string", length=255) | |
*/ | |
private $name; | |
/** | |
* @ORM\Column(type="string", length=20) | |
*/ | |
private $layout; | |
/** | |
* @Assert\File( | |
* maxSize="1M", | |
* mimeTypes={"image/png", "image/jpeg", "image/pjpeg"} | |
* ) | |
* @Vich\UploadableField(mapping="banner_image", fileNameProperty="image_path") | |
* | |
* @var File $image | |
*/ | |
protected $image; | |
/** | |
* @ORM\Column(type="string", length=255, name="image_path") | |
* | |
* @var string $image_path | |
*/ | |
protected $image_path; | |
/** | |
* @ORM\Column(type="string", length=3) | |
*/ | |
private $status = self::STATUS_OFF; | |
/** | |
* @ORM\Column(type="string", length=255) | |
*/ | |
private $link; | |
/** | |
* Get id | |
* | |
* @return integer | |
*/ | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* Set name | |
* | |
* @param string $name | |
* @return Banner | |
*/ | |
public function setName($name) | |
{ | |
$this->name = $name; | |
return $this; | |
} | |
/** | |
* Get name | |
* | |
* @return string | |
*/ | |
public function getName() | |
{ | |
return $this->name; | |
} | |
/** | |
* Set layout | |
* | |
* @param string $layout | |
* @return Banner | |
*/ | |
public function setLayout($layout) | |
{ | |
$this->layout = $layout; | |
return $this; | |
} | |
/** | |
* Get layout | |
* | |
* @return string | |
*/ | |
public function getLayout() | |
{ | |
return $this->layout; | |
} | |
/** | |
* Set image_path | |
* | |
* @param string $image_path | |
* @return Banner | |
*/ | |
public function setImagePath($imagePath) | |
{ | |
$this->image_path = $imagePath; | |
return $this; | |
} | |
/** | |
* Get image_path | |
* | |
* @return string | |
*/ | |
public function getImagePath() | |
{ | |
return $this->image_path; | |
} | |
public function getImage() | |
{ | |
return $this->image; | |
} | |
public function setImage(File $image) | |
{ | |
$this->image = $image; | |
return $this; | |
} | |
/** | |
* Set status | |
* | |
* @param string $status | |
* @return Banner | |
*/ | |
public function setStatus($status) | |
{ | |
$this->status = $status; | |
return $this; | |
} | |
/** | |
* Get status | |
* | |
* @return string | |
*/ | |
public function getStatus() | |
{ | |
return $this->status; | |
} | |
/** | |
* Set link | |
* | |
* @param string $link | |
* @return Banner | |
*/ | |
public function setLink($link) | |
{ | |
$this->link = $link; | |
return $this; | |
} | |
/** | |
* Get link | |
* | |
* @return string | |
*/ | |
public function getLink() | |
{ | |
return $this->link; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment