initialize entities

This commit is contained in:
Julien Fastré 2016-03-18 11:22:09 +01:00
parent f3b00ac69b
commit 11d58a457a
10 changed files with 800 additions and 0 deletions

130
Entity/Event.php Normal file
View File

@ -0,0 +1,130 @@
<?php
namespace Chill\EventBundle\Entity;
/**
* Event
*/
class Event
{
/**
* @var integer
*/
private $id;
/**
* @var string
*/
private $label;
/**
* @var \DateTime
*/
private $date;
/**
* @var \Doctrine\Common\Collections\Collection
*/
private $participations;
/**
* Constructor
*/
public function __construct()
{
$this->participations = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set label
*
* @param string $label
*
* @return Event
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label
*
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* Set date
*
* @param \DateTime $date
*
* @return Event
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}
/**
* Get date
*
* @return \DateTime
*/
public function getDate()
{
return $this->date;
}
/**
* Add participation
*
* @param \Chill\EventBundle\Entity\Participation $participation
*
* @return Event
*/
public function addParticipation(\Chill\EventBundle\Entity\Participation $participation)
{
$this->participations[] = $participation;
return $this;
}
/**
* Remove participation
*
* @param \Chill\EventBundle\Entity\Participation $participation
*/
public function removeParticipation(\Chill\EventBundle\Entity\Participation $participation)
{
$this->participations->removeElement($participation);
}
/**
* Get participations
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getParticipations()
{
return $this->participations;
}
}

169
Entity/EventType.php Normal file
View File

@ -0,0 +1,169 @@
<?php
namespace Chill\EventBundle\Entity;
/**
* EventType
*/
class EventType
{
/**
* @var integer
*/
private $id;
/**
* @var array
*/
private $label;
/**
* @var boolean
*/
private $active;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set label
*
* @param array $label
*
* @return EventType
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label
*
* @return array
*/
public function getLabel()
{
return $this->label;
}
/**
* Set active
*
* @param boolean $active
*
* @return EventType
*/
public function setActive($active)
{
$this->active = $active;
return $this;
}
/**
* Get active
*
* @return boolean
*/
public function getActive()
{
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
*
* @param \Chill\EventBundle\Entity\Role $role
*
* @return EventType
*/
public function addRole(\Chill\EventBundle\Entity\Role $role)
{
$this->roles[] = $role;
return $this;
}
/**
* Remove role
*
* @param \Chill\EventBundle\Entity\Role $role
*/
public function removeRole(\Chill\EventBundle\Entity\Role $role)
{
$this->roles->removeElement($role);
}
/**
* Get roles
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getRoles()
{
return $this->roles;
}
/**
* Add status
*
* @param \Chill\EventBundle\Entity\Status $status
*
* @return EventType
*/
public function addStatus(\Chill\EventBundle\Entity\Status $status)
{
$this->statuses[] = $status;
return $this;
}
/**
* Remove status
*
* @param \Chill\EventBundle\Entity\Status $status
*/
public function removeStatus(\Chill\EventBundle\Entity\Status $status)
{
$this->statuses->removeElement($status);
}
/**
* Get statuses
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getStatuses()
{
return $this->statuses;
}
}

171
Entity/Participation.php Normal file
View File

@ -0,0 +1,171 @@
<?php
namespace Chill\EventBundle\Entity;
/**
* Participation
*/
class Participation
{
/**
* @var integer
*/
private $id;
/**
* @var \DateTime
*/
private $lastUpdate;
/**
* @var \Chill\EventBundle\Entity\Event
*/
private $event;
/**
* @var \Chill\PersonBundle\Entity\Person
*/
private $person;
/**
* @var \Chill\EventBundle\Entity\Role
*/
private $role;
/**
* @var \Chill\EventBundle\Entity\Status
*/
private $status;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set lastUpdate
*
* @param \DateTime $lastUpdate
*
* @return Participation
*/
public function setLastUpdate($lastUpdate)
{
$this->lastUpdate = $lastUpdate;
return $this;
}
/**
* Get lastUpdate
*
* @return \DateTime
*/
public function getLastUpdate()
{
return $this->lastUpdate;
}
/**
* Set event
*
* @param \Chill\EventBundle\Entity\Event $event
*
* @return Participation
*/
public function setEvent(\Chill\EventBundle\Entity\Event $event = null)
{
$this->event = $event;
return $this;
}
/**
* Get event
*
* @return \Chill\EventBundle\Entity\Event
*/
public function getEvent()
{
return $this->event;
}
/**
* Set person
*
* @param \Chill\PersonBundle\Entity\Person $person
*
* @return Participation
*/
public function setPerson(\Chill\PersonBundle\Entity\Person $person = null)
{
$this->person = $person;
return $this;
}
/**
* Get person
*
* @return \Chill\PersonBundle\Entity\Person
*/
public function getPerson()
{
return $this->person;
}
/**
* Set role
*
* @param \Chill\EventBundle\Entity\Role $role
*
* @return Participation
*/
public function setRole(\Chill\EventBundle\Entity\Role $role = null)
{
$this->role = $role;
return $this;
}
/**
* Get role
*
* @return \Chill\EventBundle\Entity\Role
*/
public function getRole()
{
return $this->role;
}
/**
* Set status
*
* @param \Chill\EventBundle\Entity\Status $status
*
* @return Participation
*/
public function setStatus(\Chill\EventBundle\Entity\Status $status = null)
{
$this->status = $status;
return $this;
}
/**
* Get status
*
* @return \Chill\EventBundle\Entity\Status
*/
public function getStatus()
{
return $this->status;
}
}

113
Entity/Role.php Normal file
View File

@ -0,0 +1,113 @@
<?php
namespace Chill\EventBundle\Entity;
/**
* Role
*/
class Role
{
/**
* @var integer
*/
private $id;
/**
* @var array
*/
private $label;
/**
* @var boolean
*/
private $active;
/**
* @var \Chill\EventBundle\Entity\EventType
*/
private $type;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set label
*
* @param array $label
*
* @return Role
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label
*
* @return array
*/
public function getLabel()
{
return $this->label;
}
/**
* Set active
*
* @param boolean $active
*
* @return Role
*/
public function setActive($active)
{
$this->active = $active;
return $this;
}
/**
* Get active
*
* @return boolean
*/
public function getActive()
{
return $this->active;
}
/**
* Set type
*
* @param \Chill\EventBundle\Entity\EventType $type
*
* @return Role
*/
public function setType(\Chill\EventBundle\Entity\EventType $type = null)
{
$this->type = $type;
return $this;
}
/**
* Get type
*
* @return \Chill\EventBundle\Entity\EventType
*/
public function getType()
{
return $this->type;
}
}

114
Entity/Status.php Normal file
View File

@ -0,0 +1,114 @@
<?php
namespace Chill\EventBundle\Entity;
/**
* Status
*/
class Status
{
/**
* @var integer
*/
private $id;
/**
* @var array
*/
private $label;
/**
* @var boolean
*/
private $active;
/**
* @var \Chill\EventBundle\Entity\EventType
*/
private $type;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set label
*
* @param array $label
*
* @return Status
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label
*
* @return array
*/
public function getLabel()
{
return $this->label;
}
/**
* Set active
*
* @param boolean $active
*
* @return Status
*/
public function setActive($active)
{
$this->active = $active;
return $this;
}
/**
* Get active
*
* @return boolean
*/
public function getActive()
{
return $this->active;
}
/**
* Set type
*
* @param \Chill\EventBundle\Entity\EventType $type
*
* @return Status
*/
public function setType(\Chill\EventBundle\Entity\EventType $type = null)
{
$this->type = $type;
return $this;
}
/**
* Get type
*
* @return \Chill\EventBundle\Entity\EventType
*/
public function getType()
{
return $this->type;
}
}

View File

@ -0,0 +1,20 @@
Chill\EventBundle\Entity\Event:
type: entity
table: chill_event_event
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
label:
type: string
length: '150'
date:
type: date
oneToMany:
participations:
targetEntity: Chill\EventBundle\Entity\Participation
mappedBy: event
lifecycleCallbacks: { }

View File

@ -0,0 +1,22 @@
Chill\EventBundle\Entity\EventType:
type: entity
table: chill_event_event_type
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
label:
type: json_array
active:
type: boolean
oneToMany:
roles:
targetEntity: Chill\EventBundle\Entity\Role
mappedBy: type
statuses:
targetEntity: Chill\EventBundle\Entity\Status
mappedBy: type
lifecycleCallbacks: { }

View File

@ -0,0 +1,23 @@
Chill\EventBundle\Entity\Participation:
type: entity
table: chill_event_participation
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
lastUpdate:
type: datetime
manyToOne:
event:
targetEntity: Chill\EventBundle\Entity\Event
inversedBy: participations
person:
targetEntity: Chill\PersonBundle\Entity\Person
role:
targetEntity: Chill\EventBundle\Entity\Role
status:
targetEntity: Chill\EventBundle\Entity\Status
lifecycleCallbacks: { }

View File

@ -0,0 +1,19 @@
Chill\EventBundle\Entity\Role:
type: entity
table: chill_event_role
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
label:
type: json_array
active:
type: boolean
manyToOne:
type:
targetEntity: Chill\EventBundle\Entity\EventType
inversedBy: roles
lifecycleCallbacks: { }

View File

@ -0,0 +1,19 @@
Chill\EventBundle\Entity\Status:
type: entity
table: chill_event_status
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
label:
type: json_array
active:
type: boolean
manyToOne:
type:
targetEntity: Chill\EventBundle\Entity\EventType
inversedBy: statuses
lifecycleCallbacks: { }