update model with old fields from v1 of framadate
This commit is contained in:
parent
750692b030
commit
32d966eac3
10
doc/evolutions.md
Executable file
10
doc/evolutions.md
Executable file
@ -0,0 +1,10 @@
|
||||
# Évolutions
|
||||
Après avoir modifié le modèle de données dans les Entity, lancez la commande pour mettre à jour les getter et setters
|
||||
```bash
|
||||
php bin/console make:entity --regenerate
|
||||
```
|
||||
|
||||
et pour mettre à jour le schéma en base de données
|
||||
```bash
|
||||
php bin/console doctrine:schema:update --force
|
||||
```
|
31
migrations/Version20210419202522.php
Normal file
31
migrations/Version20210419202522.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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 Version20210419202522 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
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
|
||||
}
|
||||
}
|
@ -52,59 +52,71 @@ class Comment {
|
||||
private $poll;
|
||||
|
||||
function display() {
|
||||
return [
|
||||
'id' => $this->getId(),
|
||||
'text' => $this->getText(),
|
||||
'pseudo' => $this->getOwner()->getPseudo(),
|
||||
'date' => $this->getCreatedAt(),
|
||||
];
|
||||
}
|
||||
return [
|
||||
'id' => $this->getId(),
|
||||
'text' => $this->getText(),
|
||||
'pseudo' => $this->getOwner()->getPseudo(),
|
||||
'date' => $this->getCreatedAt(),
|
||||
];
|
||||
}
|
||||
|
||||
function __construct() {
|
||||
$this->setCreatedAt( new \DateTime() );
|
||||
}
|
||||
$this->setCreatedAt( new \DateTime() );
|
||||
}
|
||||
|
||||
public function getId(): ?int {
|
||||
return $this->id;
|
||||
}
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getOwner(): ?Owner {
|
||||
return $this->owner;
|
||||
}
|
||||
return $this->owner;
|
||||
}
|
||||
|
||||
public function setOwner( ?Owner $owner ): self {
|
||||
$this->owner = $owner;
|
||||
|
||||
return $this;
|
||||
}
|
||||
$this->owner = $owner;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getText(): ?string {
|
||||
return $this->text;
|
||||
}
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
public function setText( string $text ): self {
|
||||
$this->text = $text;
|
||||
|
||||
return $this;
|
||||
}
|
||||
$this->text = $text;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?DateTimeInterface {
|
||||
return $this->createdAt;
|
||||
}
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
public function setCreatedAt( DateTimeInterface $createdAt ): self {
|
||||
$this->createdAt = $createdAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
$this->createdAt = $createdAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPoll(): ?Poll {
|
||||
return $this->poll;
|
||||
}
|
||||
return $this->poll;
|
||||
}
|
||||
|
||||
public function setPoll( ?Poll $poll ): self {
|
||||
$this->poll = $poll;
|
||||
$this->poll = $poll;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
public function getPseudo(): ?string
|
||||
{
|
||||
return $this->pseudo;
|
||||
}
|
||||
|
||||
public function setPseudo(string $pseudo): self
|
||||
{
|
||||
$this->pseudo = $pseudo;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
1232
src/Entity/Poll.php
1232
src/Entity/Poll.php
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user