From c4e226d0bd2dd36488add29786987367d0139b95 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Wed, 2 Jun 2021 12:47:43 +0200 Subject: [PATCH] Ajout de SocialIsssue & SocialAction to ActivityType --- .../Entity/ActivityType.php | 68 +++++++++++++++++++ .../migrations/Version20210602103243.php | 36 ++++++++++ 2 files changed, 104 insertions(+) create mode 100644 src/Bundle/ChillActivityBundle/migrations/Version20210602103243.php diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index 50cd7082e..629b9187e 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -228,6 +228,26 @@ class ActivityType */ private string $socialDataLabel = ''; + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $socialIssuesVisible = self::FIELD_INVISIBLE; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $socialIssuesLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $socialActionsVisible = self::FIELD_INVISIBLE; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $socialActionsLabel = ''; + /** * @ORM\Column(type="float", options={"default"="0.0"}) */ @@ -682,4 +702,52 @@ class ActivityType return $this; } + + public function getSocialIssuesVisible(): ?int + { + return $this->socialIssuesVisible; + } + + public function setSocialIssuesVisible(int $socialIssuesVisible): self + { + $this->socialIssuesVisible = $socialIssuesVisible; + + return $this; + } + + public function getSocialIssuesLabel(): ?string + { + return $this->socialIssuesLabel; + } + + public function setSocialIssuesLabel(string $socialIssuesLabel): self + { + $this->socialIssuesLabel = $socialIssuesLabel; + + return $this; + } + + public function getSocialActionsVisible(): ?int + { + return $this->socialActionsVisible; + } + + public function setSocialActionsVisible(int $socialActionsVisible): self + { + $this->socialActionsVisible = $socialActionsVisible; + + return $this; + } + + public function getSocialActionsLabel(): ?string + { + return $this->socialActionsLabel; + } + + public function setSocialActionsLabel(string $socialActionsLabel): self + { + $this->socialActionsLabel = $socialActionsLabel; + + return $this; + } } diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210602103243.php b/src/Bundle/ChillActivityBundle/migrations/Version20210602103243.php new file mode 100644 index 000000000..78545830a --- /dev/null +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210602103243.php @@ -0,0 +1,36 @@ +addSql('ALTER TABLE activitytype ADD socialIssuesVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD socialIssuesLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD socialActionsVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD socialActionsLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ALTER category_id DROP DEFAULT'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE activitytype DROP socialIssuesVisible'); + $this->addSql('ALTER TABLE activitytype DROP socialIssuesLabel'); + $this->addSql('ALTER TABLE activitytype DROP socialActionsVisible'); + $this->addSql('ALTER TABLE activitytype DROP socialActionsLabel'); + } +}