Commit ee9446be by Damien Moulard

add comment field to User for admin

parent 11bdb966
......@@ -202,6 +202,11 @@ class User extends BaseUser
*/
public $canValidateAchat;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $comment;
public function __construct()
{
parent::__construct();
......@@ -809,4 +814,16 @@ class User extends BaseUser
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
}
......@@ -46,6 +46,13 @@ class UserFormType extends AbstractType
->add('enabled', null, [
'label' => 'Activé ?',
])
->add('comment', null, [
'label' => 'Commentaire',
'required' => false,
'attr' => array(
'placeholder' => 'Indiquez par exemple pourquoi ce compte a été désactivé'
)
])
;
}
......
<?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 Version20221129140532 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)\'');
$this->addSql('ALTER TABLE user ADD comment LONGTEXT 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 utf8mb3 DEFAULT NULL COLLATE `utf8mb3_general_ci` COMMENT \'(DC2Type:personal_data)\'');
$this->addSql('ALTER TABLE user DROP comment');
}
}
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