mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
initialize entities
This commit is contained in:
parent
f3b00ac69b
commit
11d58a457a
130
Entity/Event.php
Normal file
130
Entity/Event.php
Normal 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
169
Entity/EventType.php
Normal 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
171
Entity/Participation.php
Normal 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
113
Entity/Role.php
Normal 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
114
Entity/Status.php
Normal 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;
|
||||
}
|
||||
}
|
20
Resources/config/doctrine/Event.orm.yml
Normal file
20
Resources/config/doctrine/Event.orm.yml
Normal 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: { }
|
22
Resources/config/doctrine/EventType.orm.yml
Normal file
22
Resources/config/doctrine/EventType.orm.yml
Normal 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: { }
|
23
Resources/config/doctrine/Participation.orm.yml
Normal file
23
Resources/config/doctrine/Participation.orm.yml
Normal 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: { }
|
19
Resources/config/doctrine/Role.orm.yml
Normal file
19
Resources/config/doctrine/Role.orm.yml
Normal 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: { }
|
19
Resources/config/doctrine/Status.orm.yml
Normal file
19
Resources/config/doctrine/Status.orm.yml
Normal 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: { }
|
Loading…
x
Reference in New Issue
Block a user