« Programmation PHP avec Symfony/Doctrine » : différence entre les versions

Contenu supprimé Contenu ajouté
Ligne 393 :
{
$schema->dropTable('ma_table');
}
}
</syntaxhighlight>
 
==== Exemple PHP ====
<syntaxhighlight lang=php>
final class Version20210719125146 extends AbstractMigration implements ContainerAwareInterface
{
use ContainerAwareTrait;
 
public function up(Schema $schema) : void
{
$em = $this->container->get('doctrine.orm.entity_manager');
$monEntite = new MonEntite();
$em->persist($monEntite);
$em->flush();
}
}