mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
address: alter some address field to TEXT + add confidential field
This commit is contained in:
parent
ad05b3bf05
commit
741043c177
@ -42,10 +42,18 @@ class Address
|
|||||||
*/
|
*/
|
||||||
private $buildingName;
|
private $buildingName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*
|
||||||
|
* @ORM\Column(type="boolean")
|
||||||
|
* @Groups({"write"})
|
||||||
|
*/
|
||||||
|
private $confidential = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(type="string", length=16, nullable=true)
|
* @ORM\Column(type="string", length=255, nullable=true)
|
||||||
* @Groups({"write"})
|
* @Groups({"write"})
|
||||||
*/
|
*/
|
||||||
private $corridor;
|
private $corridor;
|
||||||
@ -78,7 +86,7 @@ class Address
|
|||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(type="string", length=16, nullable=true)
|
* @ORM\Column(type="string", length=255, nullable=true)
|
||||||
* @Groups({"write"})
|
* @Groups({"write"})
|
||||||
*/
|
*/
|
||||||
private $flat;
|
private $flat;
|
||||||
@ -86,7 +94,7 @@ class Address
|
|||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(type="string", length=16, nullable=true)
|
* @ORM\Column(type="string", length=255, nullable=true)
|
||||||
* @Groups({"write"})
|
* @Groups({"write"})
|
||||||
*/
|
*/
|
||||||
private $floor;
|
private $floor;
|
||||||
@ -143,7 +151,7 @@ class Address
|
|||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(type="string", length=16, nullable=true)
|
* @ORM\Column(type="string", length=255, nullable=true)
|
||||||
* @Groups({"write"})
|
* @Groups({"write"})
|
||||||
*/
|
*/
|
||||||
private $steps;
|
private $steps;
|
||||||
@ -192,6 +200,7 @@ class Address
|
|||||||
return (new Address())
|
return (new Address())
|
||||||
->setAddressReference($original->getAddressReference())
|
->setAddressReference($original->getAddressReference())
|
||||||
->setBuildingName($original->getBuildingName())
|
->setBuildingName($original->getBuildingName())
|
||||||
|
->setConfidential($original->getConfidential())
|
||||||
->setCorridor($original->getCorridor())
|
->setCorridor($original->getCorridor())
|
||||||
->setCustoms($original->getCustoms())
|
->setCustoms($original->getCustoms())
|
||||||
->setDistribution($original->getDistribution())
|
->setDistribution($original->getDistribution())
|
||||||
@ -234,6 +243,11 @@ class Address
|
|||||||
return $this->corridor;
|
return $this->corridor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getConfidential(): bool
|
||||||
|
{
|
||||||
|
return $this->confidential;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get customs informations in the address.
|
* Get customs informations in the address.
|
||||||
*/
|
*/
|
||||||
@ -369,6 +383,13 @@ class Address
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setConfidential(bool $confidential): self
|
||||||
|
{
|
||||||
|
$this->confidential = $confidential;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function setCorridor(?string $corridor): self
|
public function setCorridor(?string $corridor): self
|
||||||
{
|
{
|
||||||
$this->corridor = $corridor;
|
$this->corridor = $corridor;
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Main;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alter some address fields + add confidential field on Address
|
||||||
|
*/
|
||||||
|
final class Version20220124085957 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Alter some address fields + add confidential field on Address';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_main_address ADD confidential BOOLEAN DEFAULT FALSE');
|
||||||
|
$this->addSql('ALTER TABLE chill_main_address ALTER floor TYPE TEXT');
|
||||||
|
$this->addSql('ALTER TABLE chill_main_address ALTER corridor TYPE TEXT');
|
||||||
|
$this->addSql('ALTER TABLE chill_main_address ALTER steps TYPE TEXT');
|
||||||
|
$this->addSql('ALTER TABLE chill_main_address ALTER flat TYPE TEXT');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_main_address DROP confidential');
|
||||||
|
$this->addSql('ALTER TABLE chill_main_address ALTER corridor TYPE VARCHAR(16)');
|
||||||
|
$this->addSql('ALTER TABLE chill_main_address ALTER flat TYPE VARCHAR(16)');
|
||||||
|
$this->addSql('ALTER TABLE chill_main_address ALTER floor TYPE VARCHAR(16)');
|
||||||
|
$this->addSql('ALTER TABLE chill_main_address ALTER steps TYPE VARCHAR(16)');
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user