1 <?php 
declare(strict_types
=1); 
   4  * this file is part of the rapsys packbundle package. 
   6  * (c) raphaël gertz <symfony@rapsys.eu> 
   8  * for the full copyright and license information, please view the license 
   9  * file that was distributed with this source code. 
  12 namespace Rapsys\AirBundle\Entity
; 
  14 use Doctrine\Common\Collections\ArrayCollection
; 
  15 use Doctrine\ORM\Event\PreUpdateEventArgs
; 
  42          * @var ArrayCollection 
  44         private $applications; 
  47          * @var ArrayCollection 
  54         public function __construct() { 
  55                 $this->applications 
= new ArrayCollection(); 
  56                 $this->users 
= new ArrayCollection(); 
  64         public function getId(): int { 
  71          * @param string $title 
  75         public function setTitle(string $title): Dance 
{ 
  76                 $this->title 
= $title; 
  86         public function getTitle(): string { 
  93          * @param \DateTime $created 
  97         public function setCreated(\DateTime 
$created): Dance 
{ 
  98                 $this->created 
= $created; 
 108         public function getCreated(): \DateTime 
{ 
 109                 return $this->created
; 
 115          * @param \DateTime $updated 
 119         public function setUpdated(\DateTime 
$updated): Dance 
{ 
 120                 $this->updated 
= $updated; 
 130         public function getUpdated(): \DateTime 
{ 
 131                 return $this->updated
; 
 137          * @param Application $application 
 141         public function addApplication(Application 
$application): Dance 
{ 
 142                 $this->applications
[] = $application; 
 150          * @param Application $application 
 154         public function removeApplication(Application 
$application): bool { 
 155                 return $this->applications
->removeElement($application); 
 161          * @return ArrayCollection 
 163         public function getApplications(): ArrayCollection 
{ 
 164                 return $this->applications
; 
 174         public function addUser(User 
$user): Dance 
{ 
 175                 $this->users
[] = $user; 
 187         public function removeUser(User 
$user): bool { 
 188                 return $this->users
->removeElement($user); 
 194          * @return ArrayCollection 
 196         public function getUsers(): ArrayCollection 
{ 
 203         public function preUpdate(PreUpdateEventArgs 
$eventArgs) { 
 204                 //Check that we have an session instance 
 205                 if (($dance = $eventArgs->getEntity()) instanceof Dance
) { 
 207                         $dance->setUpdated(new \
DateTime('now')); 
 212          * Returns a string representation of the slot 
 216         public function __toString(): string {