Skip to content

Instantly share code, notes, and snippets.

@vittore
Created January 15, 2015 06:50
Show Gist options
  • Save vittore/d7873a9db2cf63eacbec to your computer and use it in GitHub Desktop.
Save vittore/d7873a9db2cf63eacbec to your computer and use it in GitHub Desktop.
<?php
namespace MyBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity
* @Vich\Uploadable
*/
class Event
{
use ORMBehaviors\Blameable\Blameable;
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $onStage;
/**
* @ORM\Column(type="string")
*/
private $name;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $location;
/**
* @var string
*
* @ORM\Column(name="logo", type="string", length=255, nullable=true)
*/
private $logoName;
/**
* @Assert\File(
* maxSize="3M",
* mimeTypes={"image/png", "image/jpeg", "image/gif"}
* )
* @Vich\UploadableField(mapping="event_logo", fileNameProperty="logoName")
*
* @var File $logo
*/
protected $logo;
/**
*
* @param File $file
*/
public function setLogo($file)
{
$this->logo = $file;
}
/**
*
* @return File
*/
public function getLogo()
{
return $this->logo;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set onStage
*
* @param boolean $onStage
* @return Event
*/
public function setOnStage($onStage)
{
$this->onStage = $onStage;
return $this;
}
/**
* Get onStage
*
* @return boolean
*/
public function getOnStage()
{
return $this->onStage;
}
/**
* Set name
*
* @param string $name
* @return Event
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set location
*
* @param string $location
* @return Event
*/
public function setLocation($location)
{
$this->location = $location;
return $this;
}
/**
* Get location
*
* @return string
*/
public function getLocation()
{
return $this->location;
}
/**
* Set logoName
*
* @param string $logoName
* @return Event
*/
public function setLogoName($logoName)
{
$this->logoName = $logoName;
return $this;
}
/**
* Get logoName
*
* @return string
*/
public function getLogoName()
{
return $this->logoName;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment