Introduced a BaseEntity for more easy access to all the properties.
This commit is contained in:
parent
e3ca015608
commit
12e7dafe0d
5 changed files with 97 additions and 372 deletions
|
@ -11,51 +11,42 @@ use Doctrine\ORM\PersistentCollection;
|
|||
* @ORM\Table(name="events")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class Event
|
||||
class Event extends BaseEntity
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="startdate", type="datetimetz")
|
||||
*/
|
||||
private $startdate;
|
||||
protected $startdate;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="enddate", type="datetimetz", nullable=true)
|
||||
*/
|
||||
private $enddate;
|
||||
protected $enddate;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="summary", type="string", length=255)
|
||||
*/
|
||||
private $summary;
|
||||
protected $summary;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="description", type="text", nullable=true)
|
||||
*/
|
||||
private $description;
|
||||
protected $description;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="locations_id", type="integer", nullable=true)
|
||||
*/
|
||||
private $locations_id;
|
||||
protected $locations_id;
|
||||
|
||||
/**
|
||||
* @var Location
|
||||
|
@ -63,14 +54,14 @@ class Event
|
|||
* @ORM\ManyToOne(targetEntity="Location")
|
||||
* @ORM\JoinColumn(name="locations_id", referencedColumnName="id")
|
||||
*/
|
||||
private $location;
|
||||
protected $location;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="url", type="string", length=255, nullable=true)
|
||||
*/
|
||||
private $url;
|
||||
protected $url;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
@ -81,179 +72,7 @@ class Event
|
|||
* inverseJoinColumns={@ORM\JoinColumn(name="tags_id", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
private $tags = [];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="slug", type="string", length=255,options={"default" = ""})
|
||||
*/
|
||||
private $slug = '';
|
||||
|
||||
/**
|
||||
* @param string $slug
|
||||
*/
|
||||
public function setSlug($slug)
|
||||
{
|
||||
$this->slug = $slug;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSlug()
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set startdate
|
||||
*
|
||||
* @param \DateTime $startdate
|
||||
* @return Event
|
||||
*/
|
||||
public function setStartdate($startdate)
|
||||
{
|
||||
$this->startdate = $startdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get startdate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getStartdate()
|
||||
{
|
||||
return $this->startdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set enddate
|
||||
*
|
||||
* @param \DateTime $enddate
|
||||
* @return Event
|
||||
*/
|
||||
public function setEnddate($enddate)
|
||||
{
|
||||
$this->enddate = $enddate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enddate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getEnddate()
|
||||
{
|
||||
return $this->enddate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set summary
|
||||
*
|
||||
* @param string $summary
|
||||
* @return Event
|
||||
*/
|
||||
public function setSummary($summary)
|
||||
{
|
||||
$this->summary = $summary;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get summary
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSummary()
|
||||
{
|
||||
return $this->summary;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set description
|
||||
*
|
||||
* @param string $description
|
||||
* @return Event
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set location
|
||||
*
|
||||
* @param string $locations_id
|
||||
* @return Event
|
||||
*/
|
||||
public function setLocationsID($locations_id)
|
||||
{
|
||||
$this->locations_id = $locations_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get location
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLocationsID()
|
||||
{
|
||||
return $this->locations_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set url
|
||||
*
|
||||
* @param string $url
|
||||
* @return Event
|
||||
*/
|
||||
public function setUrl($url)
|
||||
{
|
||||
$this->url = $url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get url
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
protected $tags = [];
|
||||
|
||||
/**
|
||||
* @param \Hackspace\Bundle\CalciferBundle\Entity\Location $location
|
||||
|
@ -303,7 +122,7 @@ class Event
|
|||
if (count($this->tags) > 0) {
|
||||
$tags = [];
|
||||
foreach ($this->tags as $tag) {
|
||||
$tags[] = $tag->getName();
|
||||
$tags[] = $tag->name;
|
||||
}
|
||||
return implode(',',$tags);
|
||||
} else {
|
||||
|
|
Reference in a new issue