From 4ea72f7d9d208ae6cbab1d1076be70bb0b2a5b38 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 14 Mar 2022 11:49:58 +0100 Subject: [PATCH] csfixes --- .../Entity/ThirdParty.php | 42 +++++++++---------- .../migrations/Version20220311133150.php | 19 ++++++--- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index 6e30c40dc..766c74a39 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -197,6 +197,15 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface */ private ?string $email = null; + /** + * @ORM\Column(name="firstname", type="string", length=255) + * @Assert\Length(min="2") + * @Assert\NotNull + * @Assert\NotBlank + * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) + */ + private ?string $firstname = ''; + /** * @var int * @ORM\Column(name="id", type="integer") @@ -222,15 +231,6 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface */ private ?string $name = ''; - /** - * @ORM\Column(name="firstname", type="string", length=255) - * @Assert\Length(min="2") - * @Assert\NotNull - * @Assert\NotBlank - * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) - */ - private ?string $firstname = ''; - /** * [fr] Raison sociale. * @@ -463,6 +463,11 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface return $this->email; } + public function getFirstname(): string + { + return $this->firstname; + } + public function getId(): ?int { return $this->id; @@ -478,11 +483,6 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface return $this->name; } - public function getFirstname(): string - { - return $this->firstname; - } - public function getNameCompany(): ?string { return $this->nameCompany; @@ -770,6 +770,13 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface return $this; } + public function setFirstname($firstname): self + { + $this->firstname = $firstname; + + return $this; + } + public function setKind(?string $kind): ThirdParty { $this->kind = $kind; @@ -784,13 +791,6 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface return $this; } - public function setFirstname($firstname): self - { - $this->firstname = $firstname; - - return $this; - } - /** * @param string $nameCompany */ diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20220311133150.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20220311133150.php index aec6669d8..768cd9533 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20220311133150.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20220311133150.php @@ -1,5 +1,12 @@ addSql('ALTER TABLE chill_3party.third_party DROP firstname'); + } + public function getDescription(): string { return 'Adding firstname to thirdparty'; @@ -22,10 +35,4 @@ final class Version20220311133150 extends AbstractMigration // this up() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE chill_3party.third_party ADD firstname VARCHAR(255) DEFAULT \'\' NOT NULL'); } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE chill_3party.third_party DROP firstname'); - } }