add fixtures for events

fix #17
This commit is contained in:
2016-03-22 09:59:00 +01:00
parent 9512528018
commit d7fc04cdaa
6 changed files with 278 additions and 21 deletions

View File

@@ -22,6 +22,18 @@ class Event
*/
private $date;
/**
*
* @var \Chill\MainBundle\Entity\Center
*/
private $center;
/**
*
* @var EventType
*/
private $type;
/**
* @var \Doctrine\Common\Collections\Collection
*/
@@ -77,7 +89,7 @@ class Event
*
* @return Event
*/
public function setDate($date)
public function setDate(\DateTime $date)
{
$this->date = $date;
@@ -93,6 +105,42 @@ class Event
{
return $this->date;
}
public function setCenter(\Chill\MainBundle\Entity\Center $center)
{
$this->center = $center;
return $this;
}
/**
*
* @return EventType
*/
public function getType()
{
return $this->type;
}
/**
*
* @param \Chill\EventBundle\Entity\EventType $type
* @return \Chill\EventBundle\Entity\Event
*/
public function setType(EventType $type)
{
$this->type = $type;
return $this;
}
/**
*
* @return \Chill\MainBundle\Entity\Center
*/
public function getCenter()
{
return $this->center;
}
/**
* Add participation

View File

@@ -21,7 +21,25 @@ class EventType
* @var boolean
*/
private $active;
/**
* @var \Doctrine\Common\Collections\Collection
*/
private $roles;
/**
* @var \Doctrine\Common\Collections\Collection
*/
private $statuses;
/**
* Constructor
*/
public function __construct()
{
$this->roles = new \Doctrine\Common\Collections\ArrayCollection();
$this->statuses = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
@@ -80,24 +98,6 @@ class EventType
{
return $this->active;
}
/**
* @var \Doctrine\Common\Collections\Collection
*/
private $roles;
/**
* @var \Doctrine\Common\Collections\Collection
*/
private $statuses;
/**
* Constructor
*/
public function __construct()
{
$this->roles = new \Doctrine\Common\Collections\ArrayCollection();
$this->statuses = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Add role

View File

@@ -55,9 +55,9 @@ class Participation
*
* @return Participation
*/
public function setLastUpdate($lastUpdate)
protected function update()
{
$this->lastUpdate = $lastUpdate;
$this->lastUpdate = new \DateTime('now');
return $this;
}
@@ -82,6 +82,10 @@ class Participation
*/
public function setEvent(\Chill\EventBundle\Entity\Event $event = null)
{
if ($this->event !== $event) {
$this->update();
}
$this->event = $event;
return $this;
@@ -106,6 +110,10 @@ class Participation
*/
public function setPerson(\Chill\PersonBundle\Entity\Person $person = null)
{
if ($person !== $this->person) {
$this->update();
}
$this->person = $person;
return $this;
@@ -130,6 +138,9 @@ class Participation
*/
public function setRole(\Chill\EventBundle\Entity\Role $role = null)
{
if ($role !== $this->role) {
$this->update();
}
$this->role = $role;
return $this;
@@ -154,6 +165,10 @@ class Participation
*/
public function setStatus(\Chill\EventBundle\Entity\Status $status = null)
{
if ($this->status !== $status) {
$this->update();
}
$this->status = $status;
return $this;