diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 6c4c03181..57a72e5a8 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -74,9 +74,9 @@ class Activity implements HasCenterInterface, HasScopeInterface private \DateTime $durationTime; /** - * @ORM\Column(type="time") + * @ORM\Column(type="time", nullable=true) */ - private \DateTime $travelTime; + private ?\DateTime $travelTime; /** * @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence") @@ -111,22 +111,22 @@ class Activity implements HasCenterInterface, HasScopeInterface /** * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person") */ - private ArrayCollection $persons; + private Collection $persons; /** * @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty") */ - private ArrayCollection $thirdParties; + private Collection $thirdParties; /** * @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\Document") */ - private ArrayCollection $documents; + private Collection $documents; /** * @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User") */ - private ArrayCollection $users; + private Collection $users; /** * @ORM\Column(type="boolean", options={"default"=false}) @@ -252,7 +252,7 @@ class Activity implements HasCenterInterface, HasScopeInterface /** * Get reasons */ - public function getReasons(): ArrayCollection + public function getReasons(): Collection { return $this->reasons; } @@ -347,12 +347,12 @@ class Activity implements HasCenterInterface, HasScopeInterface $this->persons->removeElement($person); } - public function getPersons(): ArrayCollection + public function getPersons(): Collection { return $this->persons; } - public function setPersons(ArrayCollection $persons): self + public function setPersons(Collection $persons): self { $this->persons = $persons; @@ -371,12 +371,12 @@ class Activity implements HasCenterInterface, HasScopeInterface $this->thirdParties->removeElement($thirdParty); } - public function getThirdParties(): ArrayCollection + public function getThirdParties(): Collection { return $this->thirdParties; } - public function setThirdParties(ArrayCollection $thirdParties): self + public function setThirdParties(Collection $thirdParties): self { $this->thirdParties = $thirdParties; @@ -395,12 +395,12 @@ class Activity implements HasCenterInterface, HasScopeInterface $this->documents->removeElement($document); } - public function getDocuments(): ArrayCollection + public function getDocuments(): Collection { return $this->documents; } - public function setDocuments(ArrayCollection $documents): self + public function setDocuments(Collection $documents): self { $this->documents = $documents; @@ -419,12 +419,12 @@ class Activity implements HasCenterInterface, HasScopeInterface $this->users->removeElement($user); } - public function getUsers(): ArrayCollection + public function getUsers(): Collection { return $this->users; } - public function setUsers(ArrayCollection $users): self + public function setUsers(Collection $users): self { $this->users = $users; diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php index 96e50f690..9a819ddf1 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php @@ -45,7 +45,7 @@ class ActivityTypeType extends AbstractType 'persons', 'user', 'date', 'place', 'persons', 'thirdParties', 'durationTime', 'travelTime', 'attendee', 'reasons', 'comment', 'sentReceived', 'documents', - 'emergency', 'accompanyingPeriod', 'socialData' + 'emergency', 'accompanyingPeriod', 'socialData', 'users' ]; foreach ($fields as $field) { $builder diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210422123846.php b/src/Bundle/ChillActivityBundle/migrations/Version20210422123846.php index a4b1c8f65..0fde71257 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210422123846.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210422123846.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Application\Migrations; +namespace Chill\Migrations\Activity; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -36,11 +36,11 @@ final class Version20210422123846 extends AbstractMigration $this->addSql('ALTER TABLE activity_thirdparty ADD CONSTRAINT FK_C6F0DE0381C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE activity_thirdparty ADD CONSTRAINT FK_C6F0DE03C7D3A8E6 FOREIGN KEY (thirdparty_id) REFERENCES chill_3party.third_party (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE activity_document ADD CONSTRAINT FK_78633A7881C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE activity_document ADD CONSTRAINT FK_78633A78C33F7837 FOREIGN KEY (document_id) REFERENCES Document (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + #$this->addSql('ALTER TABLE activity_document ADD CONSTRAINT FK_78633A78C33F7837 FOREIGN KEY (document_id) REFERENCES Document (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE activity_user ADD CONSTRAINT FK_8E570DDB81C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE activity_user ADD CONSTRAINT FK_8E570DDBA76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE activity ADD travelTime TIME(0) WITHOUT TIME ZONE NOT NULL'); + $this->addSql('ALTER TABLE activity ADD travelTime TIME(0) WITHOUT TIME ZONE DEFAULT NULL'); $this->addSql('ALTER TABLE activitytype ADD travelTimeVisible SMALLINT DEFAULT 1 NOT NULL'); $this->addSql('ALTER TABLE activitytype ADD travelTimeLabel VARCHAR(255) DEFAULT \'\' NOT NULL');