From 2f699d32b0ca14bcc08d089c341c4aea160d4d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 30 Jul 2021 13:15:09 +0200 Subject: [PATCH] create entity and schema --- .../AccompanyingPeriodWork.php | 10 + .../AccompanyingPeriodWorkEvaluation.php | 309 ++++++++++++++++++ ...companyingPeriodWorkEvaluationDocument.php | 122 +++++++ .../migrations/Version20210729163023.php | 45 +++ .../migrations/Version20210730094514.php | 47 +++ 5 files changed, 533 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php create mode 100644 src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20210729163023.php create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20210730094514.php diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index e80f37364..c491ee94d 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -160,12 +160,22 @@ use Symfony\Component\Validator\Constraints as Assert; */ private Collection $persons; + /** + * @var Collection + * @ORM\OneToMany( + * targetEntity=AccompanyingPeriodWorkEvaluation::class, + * mappedBy="accompanyingPeriodWork" + * ) + */ + private Collection $accompanyingPeriodWorkEvaluations; + public function __construct() { $this->goals = new ArrayCollection(); $this->results = new ArrayCollection(); $this->thirdParties = new ArrayCollection(); $this->persons = new ArrayCollection(); + $this->accompanyingPeriodWorkEvaluations = new ArrayCollection(); } public function getId(): ?int diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php new file mode 100644 index 000000000..10d326b9b --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php @@ -0,0 +1,309 @@ +documents = new ArrayCollection(); + } + + /** + * @return int|null + */ + public function getId(): ?int + { + return $this->id; + } + + /** + * @return AccompanyingPeriodWork|null + */ + public function getAccompanyingPeriodWork(): ?AccompanyingPeriodWork + { + return $this->accompanyingPeriodWork; + } + + /** + * @param AccompanyingPeriodWork|null $accompanyingPeriodWork + * @return AccompanyingPeriodWorkEvaluation + */ + public function setAccompanyingPeriodWork(?AccompanyingPeriodWork $accompanyingPeriodWork): AccompanyingPeriodWorkEvaluation + { + $this->accompanyingPeriodWork = $accompanyingPeriodWork; + return $this; + } + + /** + * @return Evaluation|null + */ + public function getEvaluation(): ?Evaluation + { + return $this->evaluation; + } + + /** + * @param Evaluation|null $evaluation + * @return AccompanyingPeriodWorkEvaluation + */ + public function setEvaluation(?Evaluation $evaluation): AccompanyingPeriodWorkEvaluation + { + $this->evaluation = $evaluation; + return $this; + } + + /** + * @return DateTimeImmutable|null + */ + public function getStartDate(): ?DateTimeImmutable + { + return $this->startDate; + } + + /** + * @param DateTimeImmutable|null $startDate + * @return AccompanyingPeriodWorkEvaluation + */ + public function setStartDate(?DateTimeImmutable $startDate): AccompanyingPeriodWorkEvaluation + { + $this->startDate = $startDate; + return $this; + } + + /** + * @return DateTimeImmutable|null + */ + public function getEndDate(): ?DateTimeImmutable + { + return $this->endDate; + } + + /** + * @param DateTimeImmutable|null $endDate + * @return AccompanyingPeriodWorkEvaluation + */ + public function setEndDate(?DateTimeImmutable $endDate): AccompanyingPeriodWorkEvaluation + { + $this->endDate = $endDate; + return $this; + } + + /** + * @return DateTimeImmutable|null + */ + public function getMaxDate(): ?DateTimeImmutable + { + return $this->maxDate; + } + + /** + * @param DateTimeImmutable|null $maxDate + * @return AccompanyingPeriodWorkEvaluation + */ + public function setMaxDate(?DateTimeImmutable $maxDate): AccompanyingPeriodWorkEvaluation + { + $this->maxDate = $maxDate; + return $this; + } + + /** + * @return DateInterval|null + */ + public function getWarningInterval(): ?DateInterval + { + return $this->warningInterval; + } + + /** + * @param DateInterval|null $warningInterval + * @return AccompanyingPeriodWorkEvaluation + */ + public function setWarningInterval(?DateInterval $warningInterval): AccompanyingPeriodWorkEvaluation + { + $this->warningInterval = $warningInterval; + return $this; + } + + /** + * @return string + */ + public function getComment(): string + { + return $this->comment; + } + + /** + * @param string $comment + * @return AccompanyingPeriodWorkEvaluation + */ + public function setComment(string $comment): AccompanyingPeriodWorkEvaluation + { + $this->comment = $comment; + return $this; + } + + /** + * @return User|null + */ + public function getCreatedBy(): ?User + { + return $this->createdBy; + } + + /** + * @param User|null $createdBy + * @return AccompanyingPeriodWorkEvaluation + */ + public function setCreatedBy(?User $createdBy): AccompanyingPeriodWorkEvaluation + { + $this->createdBy = $createdBy; + return $this; + } + + /** + * @return DateTimeImmutable|null + */ + public function getCreatedAt(): ?DateTimeImmutable + { + return $this->createdAt; + } + + /** + * @param DateTimeImmutable|null $createdAt + * @return AccompanyingPeriodWorkEvaluation + */ + public function setCreatedAt(\DateTimeInterface $createdAt): self + { + $this->createdAt = $createdAt; + return $this; + } + + /** + * @return User|null + */ + public function getUpdatedBy(): ?User + { + return $this->updatedBy; + } + + /** + * @param User|null $updatedBy + * @return AccompanyingPeriodWorkEvaluation + */ + public function setUpdatedBy(?User $updatedBy): AccompanyingPeriodWorkEvaluation + { + $this->updatedBy = $updatedBy; + return $this; + } + + /** + * @return DateTimeImmutable|null + */ + public function getUpdatedAt(): ?DateTimeImmutable + { + return $this->updatedAt; + } + + /** + * @param DateTimeImmutable|null $updatedAt + * @return AccompanyingPeriodWorkEvaluation + */ + public function setUpdatedAt(\DateTimeInterface $updatedAt): self + { + $this->updatedAt = $updatedAt; + return $this; + } +} diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php new file mode 100644 index 000000000..620c5bba7 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocument.php @@ -0,0 +1,122 @@ +accompanyingPeriodWorkEvaluation; + } + + /** + * @param AccompanyingPeriodWorkEvaluation|null $accompanyingPeriodWorkEvaluation + * @return AccompanyingPeriodWorkEvaluationDocument + */ + public function setAccompanyingPeriodWorkEvaluation(?AccompanyingPeriodWorkEvaluation $accompanyingPeriodWorkEvaluation): AccompanyingPeriodWorkEvaluationDocument + { + $this->accompanyingPeriodWorkEvaluation = $accompanyingPeriodWorkEvaluation; + return $this; + } + + /** + * @return StoredObject|null + */ + public function getStoredObject(): ?StoredObject + { + return $this->storedObject; + } + + /** + * @param StoredObject|null $storedObject + * @return AccompanyingPeriodWorkEvaluationDocument + */ + public function setStoredObject(?StoredObject $storedObject): AccompanyingPeriodWorkEvaluationDocument + { + $this->storedObject = $storedObject; + return $this; + } + + public function setCreatedBy(User $user): \Chill\MainBundle\Doctrine\Model\TrackCreationInterface + { + $this->createdBy = $user; + return $this; + } + + public function setCreatedAt(\DateTimeInterface $datetime): \Chill\MainBundle\Doctrine\Model\TrackCreationInterface + { + $this->createdAt = $datetime; + return $this; + } + + public function setUpdatedBy(User $user): \Chill\MainBundle\Doctrine\Model\TrackUpdateInterface + { + $this->updatedBy = $user; + return $this; + } + + public function setUpdatedAt(\DateTimeInterface $datetime): \Chill\MainBundle\Doctrine\Model\TrackUpdateInterface + { + $this->updatedAt = $datetime; + return $this; + } + + +} diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210729163023.php b/src/Bundle/ChillPersonBundle/migrations/Version20210729163023.php new file mode 100644 index 000000000..40fd84266 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210729163023.php @@ -0,0 +1,45 @@ +addSql('CREATE SEQUENCE chill_person_accompanying_period_work_evaluation_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE chill_person_accompanying_period_work_evaluation (id INT NOT NULL, evaluation_id INT DEFAULT NULL, startDate DATE DEFAULT NULL, endDate DATE DEFAULT NULL, maxDate DATE DEFAULT NULL, warningInterval INTERVAL DEFAULT NULL, createdAt DATE DEFAULT NULL, updatedAt DATE DEFAULT NULL, accompanyingPeriodWork_id INT DEFAULT NULL, createdBy_id INT DEFAULT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_741A3A0BC55C1209 ON chill_person_accompanying_period_work_evaluation (accompanyingPeriodWork_id)'); + $this->addSql('CREATE INDEX IDX_741A3A0B456C5646 ON chill_person_accompanying_period_work_evaluation (evaluation_id)'); + $this->addSql('CREATE INDEX IDX_741A3A0B3174800F ON chill_person_accompanying_period_work_evaluation (createdBy_id)'); + $this->addSql('CREATE INDEX IDX_741A3A0B65FF1AEC ON chill_person_accompanying_period_work_evaluation (updatedBy_id)'); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation.startDate IS \'(DC2Type:date_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation.endDate IS \'(DC2Type:date_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation.maxDate IS \'(DC2Type:date_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation.warningInterval IS \'(DC2Type:dateinterval)\''); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation.createdAt IS \'(DC2Type:date_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation.updatedAt IS \'(DC2Type:date_immutable)\''); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD CONSTRAINT FK_741A3A0BC55C1209 FOREIGN KEY (accompanyingPeriodWork_id) REFERENCES chill_person_accompanying_period_work (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD CONSTRAINT FK_741A3A0B456C5646 FOREIGN KEY (evaluation_id) REFERENCES chill_person_social_work_evaluation (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD CONSTRAINT FK_741A3A0B3174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD CONSTRAINT FK_741A3A0B65FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema): void + { + $this->addSql('DROP SEQUENCE chill_person_accompanying_period_work_evaluation_id_seq CASCADE'); + $this->addSql('DROP TABLE chill_person_accompanying_period_work_evaluation'); + } +} diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210730094514.php b/src/Bundle/ChillPersonBundle/migrations/Version20210730094514.php new file mode 100644 index 000000000..2748be7fd --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210730094514.php @@ -0,0 +1,47 @@ +addSql('CREATE SEQUENCE chill_person_accompanying_period_work_evaluation_document_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE chill_person_accompanying_period_work_evaluation_document (id INT NOT NULL, createdAt DATE DEFAULT NULL, updatedAt DATE DEFAULT NULL, accompanyingPeriodWorkEvaluation_id INT DEFAULT NULL, createdBy_id INT DEFAULT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_33EC9229836F75B8 ON chill_person_accompanying_period_work_evaluation_document (accompanyingPeriodWorkEvaluation_id)'); + $this->addSql('CREATE INDEX IDX_33EC92293174800F ON chill_person_accompanying_period_work_evaluation_document (createdBy_id)'); + $this->addSql('CREATE INDEX IDX_33EC922965FF1AEC ON chill_person_accompanying_period_work_evaluation_document (updatedBy_id)'); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation_document.createdAt IS \'(DC2Type:date_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation_document.updatedAt IS \'(DC2Type:date_immutable)\''); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ADD CONSTRAINT FK_33EC9229836F75B8 FOREIGN KEY (accompanyingPeriodWorkEvaluation_id) REFERENCES chill_person_accompanying_period_work_evaluation (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ADD CONSTRAINT FK_33EC92293174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ADD CONSTRAINT FK_33EC922965FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.startDate IS \'(DC2Type:date_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.endDate IS \'(DC2Type:date_immutable)\''); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD CONSTRAINT FK_B694FB365FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX IDX_B694FB365FF1AEC ON chill_person_accompanying_period_work (updatedBy_id)'); + } + + public function down(Schema $schema): void + { + $this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.startdate IS \'(DC2Type:datetimetz_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.enddate IS \'(DC2Type:datetimetz_immutable)\''); + $this->addSql('DROP TABLE chill_person_accompanying_period_work_evaluation_document'); + $this->addSql('DROP SEQUENCE chill_person_accompanying_period_work_evaluation_document_id_seq'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP CONSTRAINT FK_B694FB365FF1AEC'); + $this->addSql('DROP INDEX IDX_B694FB365FF1AEC'); + } +}