Commit ac341f87 by Yvon

allow conventionnement to be null

parent 3d14875f
...@@ -345,14 +345,8 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -345,14 +345,8 @@ class Prestataire extends AccountableObject implements AccountableInterface
/** /**
* @var float * @var float
* *
* @ORM\Column(name="conventionnement", type="decimal", scale=2) * @ORM\Column(name="conventionnement", type="decimal", scale=2, nullable=true)
* @Assert\Type("numeric") * @Assert\Type("numeric")
* @Assert\GreaterThanOrEqual(
* value = 0
* )
* @Assert\LessThanOrEqual(
* value = 1
* )
*/ */
protected $conventionnement; protected $conventionnement;
...@@ -1171,19 +1165,19 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -1171,19 +1165,19 @@ class Prestataire extends AccountableObject implements AccountableInterface
} }
/** /**
* @return float * @return mixed
*/ */
public function getConventionnement(): ?float public function getConventionnement()
{ {
return number_format($this->conventionnement, 2); return $this->conventionnement !== null ? number_format($this->conventionnement, 2) : null;
} }
/** /**
* @param float $conventionnement * @param mixed $conventionnement
* *
* @return Prestataire * @return Prestataire
*/ */
public function setConventionnement(float $conventionnement) public function setConventionnement($conventionnement)
{ {
$this->conventionnement = $conventionnement; $this->conventionnement = $conventionnement;
......
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240221094447 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\'');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\'');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240221094604 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\', CHANGE conventionnement conventionnement NUMERIC(10, 2) DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\', CHANGE conventionnement conventionnement NUMERIC(10, 2) NOT NULL');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment