new/show/edit/delete/list functionality added for accompanyingperiod task

This commit is contained in:
2021-09-17 14:33:42 +02:00
parent 537518b66f
commit 6e3ce06fcf
15 changed files with 242 additions and 116 deletions

View File

@@ -28,6 +28,7 @@ use Chill\MainBundle\Entity\HasCentersInterface;
use Chill\MainBundle\Entity\HasScopesInterface;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\Address;
use Chill\MainBundle\Entity\Center;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
@@ -977,6 +978,15 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
return $this->addressLocation;
}
public function getCenter(): ?Center
{
if (count($this->getPersons()) === 0){
return null;
} else {
return $this->getPersons()->first()->getCenter();
}
}
/**
* @Groups({"write"})
*/