<?php
namespace Score\CmsBundle\Entity\Event;
use Score\BaseBundle\Entity\BaseEntity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="Score\CmsBundle\Repository\EventRepository")
* @ORM\Table(name="cms_event")
* @ORM\HasLifecycleCallbacks()
*/
class Event extends BaseEntity {
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", length=200)
*/
protected $name;
/**
* @ORM\Column(type="text", nullable = true)
*/
protected $content;
/**
* @ORM\Column(type="text", nullable = true)
*/
protected $teaser;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $date_from;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $date_to;
/**
* @ORM\Column(type="string",length=200, nullable=true)
*/
protected $timeFrom;
/**
* @ORM\Column(type="string",length=200, nullable=true)
*/
protected $timeTo;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $published_from;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
protected $published_to;
/**
* @ORM\Column(type="string",length=1000, nullable=true)
*/
protected $url_link;
/**
* @ORM\Column(type="string",length=255, nullable=true)
*/
protected $location;
/**
* @ORM\Column(type="string",length=255, nullable=true)
*/
protected $organizer;
/**
* @ORM\Column(type="string",length=200, nullable=true)
*/
protected $phone;
/**
* @ORM\Column(type="string",length=200, nullable=true)
*/
protected $email;
/**
* @ORM\Column(type="integer", nullable=true)
*/
protected $published;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
protected $slug;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
protected $contact_person;
/**
* @ORM\Column(type="integer")
*/
protected $createdBy;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
protected $icon;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
protected $category;
/**
* @ORM\OneToMany(targetEntity="\Score\CmsBundle\Entity\Multisite\SiteItemEvent", mappedBy="event",cascade={"persist","remove"})
*/
private $siteItemEvent= [];
/**
* @ORM\Column(name="e_search", type="text", nullable=true)
*/
protected $search;
private $multisite;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set name
*
* @param string $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set content
*
* @param text $content
*/
public function setContent($content)
{
$this->content = $content;
}
/**
* Get content
*
* @return text
*/
public function getContent()
{
return $this->content;
}
/**
* Set date_from
*
* @param datetime $dateFrom
*/
public function setDateFrom($dateFrom)
{
$this->date_from = $dateFrom;
}
/**
* Get date_from
*
* @return datetime
*/
public function getDateFrom()
{
return $this->date_from;
}
/**
* Set date_to
*
* @param datetime $dateTo
*/
public function setDateTo($dateTo)
{
$this->date_to = $dateTo;
}
/**
* Get date_to
*
* @return datetime
*/
public function getDateTo()
{
return $this->date_to;
}
/**
* Set url_link
*
* @param string $urlLink
*/
public function setUrlLink($urlLink)
{
$this->url_link = $urlLink;
}
/**
* Get url_link
*
* @return string
*/
public function getUrlLink()
{
return $this->url_link;
}
/**
* Set location
*
* @param string $location
*/
public function setLocation($location)
{
$this->location = $location;
}
/**
* Get location
*
* @return string
*/
public function getLocation()
{
return $this->location;
}
/**
* Set organizer
*
* @param string $organizer
*/
public function setOrganizer($organizer)
{
$this->organizer = $organizer;
}
/**
* Get organizer
*
* @return string
*/
public function getOrganizer()
{
return $this->organizer;
}
/**
* Set phone
*
* @param string $phone
*/
public function setPhone($phone)
{
$this->phone = $phone;
}
/**
* Get phone
*
* @return string
*/
public function getPhone()
{
return $this->phone;
}
/**
* Set email
*
* @param string $email
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
* Get email
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set slug
*
* @param string $slug
*/
public function setSlug($slug)
{
$this->slug = $slug;
}
/**
* Get slug
*
* @return string
*/
public function getSlug()
{
return $this->slug;
}
/**
* Set contact_person
*
* @param string $contactPerson
*/
public function setContactPerson($contactPerson)
{
$this->contact_person = $contactPerson;
}
/**
* Get contact_person
*
* @return string
*/
public function getContactPerson()
{
return $this->contact_person;
}
/**
* Set category
*/
public function setCategory($category)
{
$this->category = $category;
}
/**
* Get category
*/
public function getCategory()
{
return $this->category;
}
/**
* Set published_from
*
* @param datetime $publishedFrom
*/
public function setPublishedFrom($publishedFrom)
{
$this->published_from = $publishedFrom;
}
/**
* Get published_from
*
* @return datetime
*/
public function getPublishedFrom()
{
return $this->published_from;
}
/**
* Set published_to
*
* @param datetime $publishedTo
*/
public function setPublishedTo($publishedTo)
{
$this->published_to = $publishedTo;
}
/**
* Get published_to
*
* @return datetime
*/
public function getPublishedTo()
{
return $this->published_to;
}
public function getCreatedBy()
{
return $this->createdBy;
}
public function setCreatedBy($createdBy)
{
$this->createdBy = $createdBy;
}
public function getIcon()
{
return $this->icon;
}
public function setIcon($icon)
{
$this->icon = $icon;
}
public function getTimeFrom()
{
return $this->timeFrom;
}
public function getTimeTo()
{
return $this->timeTo;
}
public function setTimeFrom($timeFrom)
{
$this->timeFrom = $timeFrom;
}
public function setTimeTo($timeTo)
{
$this->timeTo = $timeTo;
}
public function iconThumb($width, $height)
{
if (null == $this->getIcon())
{
return 'default_' . $width . 'x' . $height . '.png';
}
$parts = explode('.', $this->getIcon());
$extension = end($parts);
//return $extension;
return str_replace('.' . $extension, '', $this->getIcon()) . '_thumb_' . $width . 'x' . $height . '.' . $extension;
}
public function getTerminString($format = 'd.m.Y')
{
if (null != $this->getDateFrom())
{
$start = $this->getDateFrom()->format($format);
$end = $this->getDateTo()->format($format);
return $start . ' - ' . $end;
}
}
/**
* Get the value of published
*/
public function getPublished()
{
return $this->published;
}
/**
* Set the value of published
*
* @return self
*/
public function setPublished($published)
{
$this->published = $published;
return $this;
}
/**
* Get the value of teaser
*/
public function getTeaser()
{
return $this->teaser;
}
/**
* Set the value of teaser
*
* @return self
*/
public function setTeaser($teaser)
{
$this->teaser = $teaser;
return $this;
}
/**
* Get the value of siteItemEvent
*/
public function getSiteItemEvent()
{
return $this->siteItemEvent;
}
/**
* Set the value of siteItemEvent
*
* @return self
*/
public function setSiteItemEvent($siteItemEvent)
{
$this->siteItemEvent = $siteItemEvent;
return $this;
}
/**
* Get the value of multisite
*/
public function getMultisite()
{
return $this->multisite;
}
/**
* Set the value of multisite
*
* @return self
*/
public function setMultisite($multisite)
{
$this->multisite = $multisite;
return $this;
}
/**
* Get the value of search
*/
public function getSearch()
{
return $this->search;
}
/**
* Set the value of search
*
* @return self
*/
public function setSearch($search)
{
$this->search = $search;
return $this;
}
}