<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wiki.jordan-lenuff.com/index.php?action=history&amp;feed=atom&amp;title=Technique%2FSymfony%2FCr%C3%A9ation_d%27une_application</id>
	<title>Technique/Symfony/Création d'une application - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.jordan-lenuff.com/index.php?action=history&amp;feed=atom&amp;title=Technique%2FSymfony%2FCr%C3%A9ation_d%27une_application"/>
	<link rel="alternate" type="text/html" href="https://wiki.jordan-lenuff.com/index.php?title=Technique/Symfony/Cr%C3%A9ation_d%27une_application&amp;action=history"/>
	<updated>2026-05-15T20:59:15Z</updated>
	<subtitle>Historique des révisions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://wiki.jordan-lenuff.com/index.php?title=Technique/Symfony/Cr%C3%A9ation_d%27une_application&amp;diff=555&amp;oldid=prev</id>
		<title>Jordan : /* Formulaires */</title>
		<link rel="alternate" type="text/html" href="https://wiki.jordan-lenuff.com/index.php?title=Technique/Symfony/Cr%C3%A9ation_d%27une_application&amp;diff=555&amp;oldid=prev"/>
		<updated>2020-03-02T08:59:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Formulaires&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Version du 2 mars 2020 à 08:59&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l613&quot; &gt;Ligne 613 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 613 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Formulaires ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Formulaires ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=== Créer un formulaire avec la console ===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Grâce au [https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html bundle SymfonyMaker], il est possible de créer automatiquement la classe de formulaire de l'entité désirée. Pour ce faire, lancer la commande suivante :&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; php bin/console make:form&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Cela donnera par exemple le retour suivant :&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{terminal|text=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[php-fpm@myserver APPLI]$ php bin/console make:form&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; The name of the form class (e.g. DeliciousChefType):&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &amp;gt; CompanyType&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; The name of Entity or fully qualified model class name that the new form will be bound to (empty for none):&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &amp;gt; Company&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; created: src/Form/CompanyType.php&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;           &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  Success! &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;           &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; Next: Add fields to your form and start using it.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; Find the documentation at https://symfony.com/doc/current/forms.html&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dont le contenu du fichier &amp;lt;code&amp;gt;src/Form/CompanyType.php&amp;lt;/code&amp;gt; sera :&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;?php&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;namespace App\Form;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use App\Entity\Company;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use Symfony\Component\Form\AbstractType;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use Symfony\Component\Form\FormBuilderInterface;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use Symfony\Component\OptionsResolver\OptionsResolver;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;class CompanyType extends AbstractType&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    public function buildForm(FormBuilderInterface $builder, array $options)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        $builder&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            -&amp;gt;add('name')&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        ;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    public function configureOptions(OptionsResolver $resolver)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        $resolver-&amp;gt;setDefaults([&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            'data_class' =&amp;gt; Company::class,&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        ]);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Modifier le fichier en y ajoutant les lignes suivantes :&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; highlight=&amp;quot;7,17&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;?php&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;namespace App\Form;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use App\Entity\Company;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use Symfony\Component\Form\AbstractType;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use Symfony\Component\Form\Extension\Core\Type\SubmitType;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use Symfony\Component\Form\FormBuilderInterface;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;use Symfony\Component\OptionsResolver\OptionsResolver;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;class CompanyType extends AbstractType&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    public function buildForm(FormBuilderInterface $builder, array $options)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        $builder&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            -&amp;gt;add('name')&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            -&amp;gt;add('save', SubmitType::class)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        ;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    public function configureOptions(OptionsResolver $resolver)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        $resolver-&amp;gt;setDefaults([&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            'data_class' =&amp;gt; Company::class,&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        ]);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki_db:diff::1.12:old-554:rev-555 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jordan</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.jordan-lenuff.com/index.php?title=Technique/Symfony/Cr%C3%A9ation_d%27une_application&amp;diff=554&amp;oldid=prev</id>
		<title>Jordan : /* Récupérer un objet en BDD */</title>
		<link rel="alternate" type="text/html" href="https://wiki.jordan-lenuff.com/index.php?title=Technique/Symfony/Cr%C3%A9ation_d%27une_application&amp;diff=554&amp;oldid=prev"/>
		<updated>2020-03-02T08:50:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Récupérer un objet en BDD&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Version du 2 mars 2020 à 08:50&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l611&quot; &gt;Ligne 611 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 611 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Récupérer un objet en BDD ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Récupérer un objet en BDD ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Formulaires ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki_db:diff::1.12:old-471:rev-554 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jordan</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.jordan-lenuff.com/index.php?title=Technique/Symfony/Cr%C3%A9ation_d%27une_application&amp;diff=471&amp;oldid=prev</id>
		<title>Jordan : Page créée avec « == Présentation == Cette page/section a pour objet de lister les différentes actions pour créer une application PHP.  Cette page/section n'est pas finalisée et les don… »</title>
		<link rel="alternate" type="text/html" href="https://wiki.jordan-lenuff.com/index.php?title=Technique/Symfony/Cr%C3%A9ation_d%27une_application&amp;diff=471&amp;oldid=prev"/>
		<updated>2020-01-17T16:52:03Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « == Présentation == Cette page/section a pour objet de lister les différentes actions pour créer une application PHP.  Cette page/section n&amp;#039;est pas finalisée et les don… »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Présentation ==&lt;br /&gt;
Cette page/section a pour objet de lister les différentes actions pour créer une application PHP.&lt;br /&gt;
&lt;br /&gt;
Cette page/section n'est pas finalisée et les données qu'elle contient vont régulièrement évoluer.&lt;br /&gt;
&lt;br /&gt;
== Pour commencer ==&lt;br /&gt;
Le serveur utilisé pour la démonstration est '''myserver'''. La nouvelle application à créer est '''GreatApp'''.&lt;br /&gt;
&lt;br /&gt;
Créer le dossier applicatif de développement et s'y rendre :&lt;br /&gt;
 mkdir -p /data/www/dev-greatapp&lt;br /&gt;
 cd /data/www/dev-greatapp&lt;br /&gt;
&lt;br /&gt;
Créer le lien symbolique &amp;lt;code&amp;gt;APPLI&amp;lt;/code&amp;gt; pointant vers la version en cours :&lt;br /&gt;
 ln -s 1.0.0 APPLI&lt;br /&gt;
&lt;br /&gt;
Créer les dossiers de l'architecture applicative normalisée :&lt;br /&gt;
 mkdir {DATA,LOG,PARAM}&lt;br /&gt;
&lt;br /&gt;
== Installation Symfony ==&lt;br /&gt;
Télécharger l'installeur du framework Symfony :&lt;br /&gt;
 wget https://get.symfony.com/cli/installer -O - | bash&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Exemple de retour :&amp;lt;/u&amp;gt;&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
[root@myserver dev-greatapp]# wget https://get.symfony.com/cli/installer -O - {{!}} bash&lt;br /&gt;
--2019-11-21 11:34:08--  https://get.symfony.com/cli/installer&lt;br /&gt;
Résolution de get.symfony.com (get.symfony.com)... 143.204.15.125, 143.204.15.50, 143.204.15.106, ...&lt;br /&gt;
Connexion vers get.symfony.com (get.symfony.com){{!}}143.204.15.125{{!}}:443...connecté.&lt;br /&gt;
requête HTTP transmise, en attente de la réponse...200 OK&lt;br /&gt;
Longueur: 4713 (4,6K) [binary/octet-stream]&lt;br /&gt;
Sauvegarde en : «STDOUT»&lt;br /&gt;
&lt;br /&gt;
100%[===================================================================================================================================================================================================&amp;gt;] 4 713       --.-K/s   ds 0s&lt;br /&gt;
&lt;br /&gt;
2019-11-21 11:34:08 (441 MB/s) - envoi vers sortie standard [4713/4713]&lt;br /&gt;
&lt;br /&gt;
Symfony CLI installer&lt;br /&gt;
&lt;br /&gt;
Environment check&lt;br /&gt;
  [*] cURL is installed&lt;br /&gt;
  [*] Gzip is installed&lt;br /&gt;
  [*] Git is installed&lt;br /&gt;
&lt;br /&gt;
Download&lt;br /&gt;
  Finding the latest version (platform: &amp;quot;linux_amd64&amp;quot;)...&lt;br /&gt;
  Downloading version 4.10.2 (https://github.com/symfony/cli/releases/download/v4.10.2/symfony_linux_amd64.gz)...&lt;br /&gt;
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current&lt;br /&gt;
                                 Dload  Upload   Total   Spent    Left  Speed&lt;br /&gt;
100   613    0   613    0     0    783      0 --:--:-- --:--:-- --:--:--   783&lt;br /&gt;
100 7494k  100 7494k    0     0  1163k      0  0:00:06  0:00:06 --:--:-- 1534k&lt;br /&gt;
  Uncompress binary...&lt;br /&gt;
  Making the binary executable...&lt;br /&gt;
  Installing the binary into your home directory...&lt;br /&gt;
  The binary was saved to: /root/.symfony/bin/symfony&lt;br /&gt;
&lt;br /&gt;
The Symfony CLI v4.10.2 was installed successfully!&lt;br /&gt;
&lt;br /&gt;
Add this to your shell configuration file:&lt;br /&gt;
  export PATH=&amp;quot;$HOME/.symfony/bin:$PATH&amp;quot;&lt;br /&gt;
Start a new shell, and then run 'symfony'&lt;br /&gt;
&lt;br /&gt;
Or install it globally on your system:&lt;br /&gt;
  mv /root/.symfony/bin/symfony /usr/local/bin/symfony&lt;br /&gt;
and then run 'symfony'&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Dans le cas où le serveur serait utilisé à des fins de plusieurs développements sous Symfony, il conviendrait d'ajouter la commande Symfony de façon globale au serveur.&lt;br /&gt;
&lt;br /&gt;
Etant donné que le serveur '''myserver''' n'est pas un serveur de développement, il convient d'ajouter la commande Symfony à l'utilisateur courant. Pour ce faire, éditer le fichier &amp;lt;code&amp;gt;$HOME/.bashrc&amp;lt;/code&amp;gt; et y ajouter la ligne suivante :&lt;br /&gt;
 export PATH=&amp;quot;$HOME/.symfony/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Pour que la modification soit effective, quitter la session et se reconnecter, ou bien sourcer le fichier en lançant la commande &amp;lt;code&amp;gt;. $HOME/.bashrc&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Nouveau projet Symfony ==&lt;br /&gt;
=== Création ===&lt;br /&gt;
Se rendre dans le dossier de l'application :&lt;br /&gt;
 cd /data/www/dev-greatapp&lt;br /&gt;
&lt;br /&gt;
Lancer la commande de création d'un nouveau projet Symfony :&lt;br /&gt;
 symfony new 1.0.0 --full&lt;br /&gt;
&lt;br /&gt;
=== En cas d'erreur ===&lt;br /&gt;
Si Composer n'est pas installé, Symfony affichera une erreur :&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
[root@myserver dev-greatapp]# symfony new 1.0.0 --full&lt;br /&gt;
&lt;br /&gt;
Version 4.11.3 is available. Do you want to update now (execution will continue after whatever you decide) ? [Y/n]: Y&lt;br /&gt;
&lt;br /&gt;
Update notes:&lt;br /&gt;
  v4.11.3:&lt;br /&gt;
  - Fix loading the local ``php.ini`` on FPM (loading PHP extensions now works)&lt;br /&gt;
  - Fix loading PHP config from ``.symfony.cloud.yaml`` for web servers using PHP CGI or PHP CLI&lt;br /&gt;
  - Remove ``php:wrappers:install`` and supports for the PHP wrappers (use ``symfony php/pecl/...`` instead)&lt;br /&gt;
  - Update extension list for PHP 7.4&lt;br /&gt;
  - Fix infinite login loop when used in non interactive environment&lt;br /&gt;
  - Add Blackfire integration when using Docker for the Blackfire agent&lt;br /&gt;
  - Fix ``open:remote:rabbitmq`` does not found the RabbitMQ management UI&lt;br /&gt;
  - Specify which environment will be snapshoted when running ``env:sync``&lt;br /&gt;
  - Fix double spinner issue on ``env:sync``&lt;br /&gt;
&lt;br /&gt;
  v4.11.2:&lt;br /&gt;
  - Fix panic when no PHP versions are detected&lt;br /&gt;
&lt;br /&gt;
  v4.11.1:&lt;br /&gt;
  - Fix going into background makes parent process hang&lt;br /&gt;
  - Remove ``--force-php-discovery`` flag on ``server:start``&lt;br /&gt;
&lt;br /&gt;
  v4.11.0:&lt;br /&gt;
  - Allow customers to stop or decline a cloud trial and move to a paid subscription directly&lt;br /&gt;
  - Add command ``project:billing:accept`` to disable project suspension at then end of trial&lt;br /&gt;
  - Rename ``billing:update:card`` command to ``project:billing:update-card``&lt;br /&gt;
  - Fix detection of the default PHP version from PATH&lt;br /&gt;
  - Fix PHP version used when executing `php` in a sub-process&lt;br /&gt;
  - Add Docker Compose detection when configured via `COMPOSE_FILE`&lt;br /&gt;
  - Allow to configure COMPOSE_PROJECT_NAME via .env&lt;br /&gt;
&lt;br /&gt;
Upgrading to 4.11.3&lt;br /&gt;
 7.33 MiB / 7.33 MiB [===================================] 100.00% 1.36 MiB/s 5s&lt;br /&gt;
2020/01/06 10:02:46 Integrity check in 27490 from 27382.&lt;br /&gt;
Upgrade done, now relaunching.&lt;br /&gt;
2020/01/06 10:02:46 Continue execution here in 27509 from 27382.&lt;br /&gt;
* Creating a new Symfony project with Composer&lt;br /&gt;
  WARNING Unable to find Composer, downloading one. It is recommended to install Composer yourself at https://getcomposer.org/download/&lt;br /&gt;
  (running /root/.symfony/bin/composer create-project symfony/website-skeleton 1.0.0)&lt;br /&gt;
&lt;br /&gt;
/usr/bin/env: php: Aucun fichier ou dossier de ce type&lt;br /&gt;
&lt;br /&gt;
  unable to run /root/.symfony/bin/composer create-project symfony/website-skeleton 1.0.0 : exit status 127&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Suivre la procédure d'[[Technique/PHP/Composer#Installation|installation de Composer]] pour régler cette erreur.&lt;br /&gt;
&lt;br /&gt;
=== Absence d'erreur ===&lt;br /&gt;
En cas d'absence d'erreur, la sortie ressemble à ceci :&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
[root@myserver dev-greatapp]# symfony new 1.0.0 --full&lt;br /&gt;
* Creating a new Symfony project with Composer&lt;br /&gt;
  (running /root/.symfony/bin/composer create-project symfony/website-skeleton 1.0.0)&lt;br /&gt;
&lt;br /&gt;
* Setting up the project under Git version control&lt;br /&gt;
  (running git init 1.0.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [OK] Your project is now ready in /data/www/dev-greatapp/1.0.0&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Correction des droits ===&lt;br /&gt;
Corriger les droits en lançant la commande :&lt;br /&gt;
 chown -R php-fpm:www /data/www/dev-greatapp&lt;br /&gt;
&lt;br /&gt;
L'application Symfony vierge est disponible :&lt;br /&gt;
:[[Fichier:ClipCapIt-200117-174448.PNG|none|thumb|300px|Symfony - Page d'accueil vierge]]&lt;br /&gt;
&lt;br /&gt;
== Installation de bundles ==&lt;br /&gt;
Certains bundles de base doivent être installés :&lt;br /&gt;
*symfony/apache-pack&lt;br /&gt;
**Ce bundle installe un fichier &amp;lt;code&amp;gt;.htaccess&amp;lt;/code&amp;gt; contenant les règles de ré-écriture dans le dossier &amp;lt;code&amp;gt;public&amp;lt;/code&amp;gt;&lt;br /&gt;
*annotations&lt;br /&gt;
**Ce pack permet de définir des routes en ajoutant des annotations dans les contrôleurs plutôt que dans le fichier &amp;lt;code&amp;gt;config/routes.yaml&amp;lt;/code&amp;gt;&lt;br /&gt;
*twig&lt;br /&gt;
**Ce pack permet d'utiliser un langage de template, Twig, permettant l'utilisation de modèles HTML&lt;br /&gt;
&amp;lt;!--*symfony/webpack-encore-bundle&lt;br /&gt;
**Webpack Encore est un moyen plus simple d'intégrer Webpack dans l'application Symfony. Il englobe Webpack, offrant une API propre et puissante pour regrouper les modules JavaScript, pré-traiter les CSS et JS et compiler et réduire les fichiers-ressources nécessaires.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pour installer un bundle, par exemple &amp;lt;code&amp;gt;symfony/apache-pack&amp;lt;/code&amp;gt;, lancer la commande suivante :&lt;br /&gt;
 composer require symfony/apache-pack&lt;br /&gt;
&lt;br /&gt;
Le résultat ressemble à ceci :&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
[php-fpm@myserver APPLI]$ composer require symfony/apache-pack&lt;br /&gt;
Using version ^1.0 for symfony/apache-pack&lt;br /&gt;
./composer.json has been updated&lt;br /&gt;
Loading composer repositories with package information&lt;br /&gt;
Updating dependencies (including require-dev)&lt;br /&gt;
Restricting packages listed in &amp;quot;symfony/symfony&amp;quot; to &amp;quot;5.0.*&amp;quot;&lt;br /&gt;
Package operations: 1 install, 0 updates, 0 removals&lt;br /&gt;
  - Installing symfony/apache-pack (v1.0.1): Loading from cache&lt;br /&gt;
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.&lt;br /&gt;
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.&lt;br /&gt;
Writing lock file&lt;br /&gt;
Generating autoload files&lt;br /&gt;
ocramius/package-versions: Generating version class...&lt;br /&gt;
ocramius/package-versions: ...done generating version class&lt;br /&gt;
Symfony operations: 1 recipe (75eba4e176ac9e0cc03e38c2ca0ae992)&lt;br /&gt;
  -  WARNING  symfony/apache-pack (&amp;gt;=1.0): From github.com/symfony/recipes-contrib:master&lt;br /&gt;
    The recipe for this package comes from the &amp;quot;contrib&amp;quot; repository, which is open to community contributions.&lt;br /&gt;
    Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/symfony/apache-pack/1.0&lt;br /&gt;
&lt;br /&gt;
    Do you want to execute this recipe?&lt;br /&gt;
    [y] Yes&lt;br /&gt;
    [n] No&lt;br /&gt;
    [a] Yes for all packages, only for the current installation session&lt;br /&gt;
    [p] Yes permanently, never ask again for this project&lt;br /&gt;
    (defaults to n): y&lt;br /&gt;
  - Configuring symfony/apache-pack (&amp;gt;=1.0): From github.com/symfony/recipes-contrib:master&lt;br /&gt;
Executing script cache:clear [OK]&lt;br /&gt;
Executing script assets:install public [OK]&lt;br /&gt;
&lt;br /&gt;
Some files may have been created or updated to configure your new packages.&lt;br /&gt;
Please review, edit and commit them: these files are yours.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pour annotations :&lt;br /&gt;
 composer require annotations&lt;br /&gt;
&lt;br /&gt;
Pour Twig :&lt;br /&gt;
 composer require twig&lt;br /&gt;
&lt;br /&gt;
== .htaccess ==&lt;br /&gt;
Comme stipulé dans la [https://symfony.com/doc/current/setup/web_server_configuration.html#adding-rewrite-rules documentation officielle de Symfony], il est possible de gagner en performance en déplaçant le contenu du fichier &amp;lt;code&amp;gt;public/.htaccess&amp;lt;/code&amp;gt; précédemment créé lors de l'installation du bundle &amp;lt;code&amp;gt;symfony/apache-pack&amp;lt;/code&amp;gt; dans la configuration du VirtualHost d'Apache.&lt;br /&gt;
&lt;br /&gt;
Pour ce faire, dans le VirtualHost, ou la directive &amp;lt;code&amp;gt;Directory&amp;lt;/code&amp;gt; en cas de présence de l'application dans un sous-répertoire, modifier la valeur de la directive &amp;lt;code&amp;gt;AllowOverride&amp;lt;/code&amp;gt; de '''All''' à '''None''' et ajouter la ligne &amp;lt;code&amp;gt;Include conf/sites/greatapp_htaccess&amp;lt;/code&amp;gt;. Cela donne la modification suivante :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;apache&amp;quot; highlight=7,12&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
	# Configuration greatapp&lt;br /&gt;
	Alias /greatapp /data/www/dev-greatapp/APPLI/public&lt;br /&gt;
	&amp;lt;Directory &amp;quot;/data/www/dev-greatapp/APPLI/public&amp;quot;&amp;gt;&lt;br /&gt;
		Options FollowSymLinks&lt;br /&gt;
		DirectoryIndex index.php&lt;br /&gt;
		AllowOverride None&lt;br /&gt;
		Require all granted&lt;br /&gt;
		&amp;lt;FilesMatch \.php$&amp;gt;&lt;br /&gt;
			SetHandler &amp;quot;proxy:unix:/local/php/sockets/php7_greatapp.sock|fcgi://localhost/&amp;quot;&lt;br /&gt;
		&amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
		Include conf/sites/greatapp_htaccess&lt;br /&gt;
	&amp;lt;/Directory&amp;gt;&lt;br /&gt;
	# Fin de configuration greatapp&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Créer ensuite le fichier &amp;lt;code&amp;gt;conf/sites/greatapp_htaccess&amp;lt;/code&amp;gt; et y ajouter le contenu du fichier &amp;lt;code&amp;gt;.htaccess&amp;lt;/code&amp;gt; précédemment créé.&lt;br /&gt;
&lt;br /&gt;
OPTIONNEL : Le fichier &amp;lt;code&amp;gt;.htaccess&amp;lt;/code&amp;gt; peut être vidé afin de lever toute ambiguïté sur la provenance des règles appliquées sur l'instance en cours. Toutefois, en cas de ré-utilisation des sources de l'application sur une autre instance, il faudra alors s'assurer de récupérer les règles depuis le fichier &amp;lt;code&amp;gt;conf/sites/greatapp_htaccess&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Doctrine ==&lt;br /&gt;
Cette section s'inspire fortement de la [https://symfony.com/doc/current/doctrine.html documentation officielle de Symfony sur Doctrine].&lt;br /&gt;
=== Installation ===&lt;br /&gt;
Pour installer les bundles nécessaires à l'utilisation de Doctrine dans Symfony, il faut installer le pack &amp;quot;[https://github.com/symfony/orm-pack symfony/orm-pack]&amp;quot; qui est composé d'un simple fichier &amp;lt;code&amp;gt;composer.json&amp;lt;/code&amp;gt; dont le contenu actuel est le suivant :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;name&amp;quot;: &amp;quot;symfony/orm-pack&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;symfony-pack&amp;quot;,&lt;br /&gt;
    &amp;quot;license&amp;quot;: &amp;quot;MIT&amp;quot;,&lt;br /&gt;
    &amp;quot;description&amp;quot;: &amp;quot;A pack for the Doctrine ORM&amp;quot;,&lt;br /&gt;
    &amp;quot;require&amp;quot;: {&lt;br /&gt;
        &amp;quot;php&amp;quot;: &amp;quot;^7.0&amp;quot;,&lt;br /&gt;
        &amp;quot;doctrine/orm&amp;quot;: &amp;quot;^2.5.11&amp;quot;,&lt;br /&gt;
        &amp;quot;doctrine/doctrine-bundle&amp;quot;: &amp;quot;^1.6.10|^2.0&amp;quot;,&lt;br /&gt;
        &amp;quot;doctrine/doctrine-migrations-bundle&amp;quot;: &amp;quot;^1.3|^2.0&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pour ce faire, dans le dossier de l'application, lancer la commande suivante :&lt;br /&gt;
 composer require symfony/orm-pack&lt;br /&gt;
&lt;br /&gt;
La documentation Symfony recommande également d'installer le bundle &amp;quot;[https://github.com/symfony/maker-bundle symfony/maker-bundle]&amp;quot; afin de créer facilement des commandes vides, des contrôleurs, des classes de formulaire, des tests et plus encore. Ce bundle est une alternative à SensioGeneratorBundle pour les applications Symfony modernes et nécessite l'utilisation de Symfony 3.4 ou plus récent. Cet ensemble implique d'utiliser une structure de répertoire Symfony 4 standard, mais de nombreuses commandes peuvent générer du code dans n'importe quelle application.&lt;br /&gt;
&lt;br /&gt;
Ce bundle étant nécessaire que dans des phases de développement de l'application, l'installer avec l'option &amp;lt;code&amp;gt;--dev&amp;lt;/code&amp;gt; :&lt;br /&gt;
 composer require --dev symfony/maker-bundle&lt;br /&gt;
&lt;br /&gt;
=== Paramètre base de données ===&lt;br /&gt;
Doctrine devant se connecter à une (ou plusieurs) base de données, il faudra s'assurer, au préalable, [[Technique/MySQL/Commandes_courantes#Cr.C3.A9er_un_utilisateur_en_lui_ajoutant_des_droits|d'avoir créé un utilisateur ayant les droits sur la future base de données]]. Il n'est pas nécessaire de créer la base de données au travers de MySQL, Doctrine pourra le faire grâce aux droits données à l'utilisateur. Il faut donc spécifier correctement les droits lors de la création de l'utilisateur.&lt;br /&gt;
&lt;br /&gt;
Afin que Doctrine puisse se connecter à ladite base de données, il faut définir la variable d'environnement &amp;lt;code&amp;gt;DATABASE_URL&amp;lt;/code&amp;gt;. Voir la [https://symfony.com/doc/current/configuration.html#configuration-based-on-environment-variables documentation Symfony à propos de la configuration basée sur les variables d'environnement] et les différentes manières de les définir (fichier &amp;lt;code&amp;gt;.env&amp;lt;/code&amp;gt;, variable de shell, variable d'environnement serveur, ...).&lt;br /&gt;
&lt;br /&gt;
Ainsi, par exemple, la variable &amp;lt;code&amp;gt;DATABASE_URL&amp;lt;/code&amp;gt; sera définie dans le socket php-fpm de l'application, dans le fichier &amp;lt;code&amp;gt;/local/php/php-7.3.4/etc/php-fpm.d/greatapp.conf&amp;lt;/code&amp;gt; :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
env[DATABASE_URL] = &amp;quot;mysql://dev_greatapp_user:xxxxxxxxxxxx@127.0.0.1:3306/dev_greatapp_db&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB : Si la première connexion à la base de données au travers de Doctrine échoue, ne pas hésiter à remplacer &amp;lt;code&amp;gt;127.0.0.1&amp;lt;/code&amp;gt; par &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt; (ou inversement) dans la chaîne de connexion.&lt;br /&gt;
&lt;br /&gt;
=== Créer la base de données via Doctrine ===&lt;br /&gt;
Si les droits ont correctement été définis lors de la création de l'utilisateur, Doctrine va être en mesure de créer automatiquement la base de données.&lt;br /&gt;
&lt;br /&gt;
:NB : dans le cas d'une définition de la variable &amp;lt;code&amp;gt;DATABASE_URL&amp;lt;/code&amp;gt; directement dans Apache ou PHP-FPM, elle ne sera pas accessible en ligne de commande. Pour l'utiliser, il faudra la définir dans le shell grâce à la commande &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt;. Pour ceux devant manipuler plusieurs applications et plusieurs connexions aux bases de données différentes, il est possible de créer plusieurs fichiers &amp;lt;code&amp;gt;env_&amp;lt;nom_application&amp;gt;&amp;lt;/code&amp;gt; dans lesquels renseigner les lignes suivantes :&lt;br /&gt;
 DATABASE_URL=&amp;quot;mysql://application_user:password@127.0.0.1:3306/application_db&amp;quot;&lt;br /&gt;
 export DATABASE_URL&lt;br /&gt;
&lt;br /&gt;
:Et ensuite, en  fonction de l'application sur laquelle travailler, il faut sourcer le fichier :&lt;br /&gt;
 . env_dev-greatapp&lt;br /&gt;
&lt;br /&gt;
Pour créer la base de données, lancer la commande &amp;lt;code&amp;gt;php bin/console doctrine:database:create&amp;lt;/code&amp;gt;. Exemple :&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
[php-fpm@myserver APPLI]$ php bin/console doctrine:database:create&lt;br /&gt;
Created database `dev_greatapp_db` for connection named default&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Créer une classe d’entité ===&lt;br /&gt;
Symfony étant un framework reposant sur de la programmation OOP (ou POO pour PHP Orienté Objet), il faut donc raisonner en &amp;quot;objet&amp;quot; (appelé &amp;quot;entités&amp;quot; sous Symfony). Ainsi, pour représenter et manipuler les objets de l'application à créer, il faut créer des entités.&lt;br /&gt;
&lt;br /&gt;
Pour ce faire, lancer la commande &amp;lt;code&amp;gt;php bin/console make:entity&amp;lt;/code&amp;gt;. Exemple :&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
[php-fpm@myserver APPLI]$ php bin/console make:entity&lt;br /&gt;
&lt;br /&gt;
 Class name of the entity to create or update (e.g. OrangePizza):&lt;br /&gt;
 &amp;gt; Application&lt;br /&gt;
&lt;br /&gt;
 created: src/Entity/Application.php&lt;br /&gt;
 created: src/Repository/ApplicationRepository.php&lt;br /&gt;
&lt;br /&gt;
 Entity generated! Now let's add some fields!&lt;br /&gt;
 You can always add more fields later manually or by re-running this command.&lt;br /&gt;
&lt;br /&gt;
 New property name (press &amp;lt;return&amp;gt; to stop adding fields):&lt;br /&gt;
 &amp;gt; name&lt;br /&gt;
&lt;br /&gt;
 Field type (enter ? to see all types) [string]:&lt;br /&gt;
 &amp;gt; ?&lt;br /&gt;
&lt;br /&gt;
Main types&lt;br /&gt;
  * string&lt;br /&gt;
  * text&lt;br /&gt;
  * boolean&lt;br /&gt;
  * integer (or smallint, bigint)&lt;br /&gt;
  * float&lt;br /&gt;
&lt;br /&gt;
Relationships / Associations&lt;br /&gt;
  * relation (a wizard 🧙 will help you build the relation)&lt;br /&gt;
  * ManyToOne&lt;br /&gt;
  * OneToMany&lt;br /&gt;
  * ManyToMany&lt;br /&gt;
  * OneToOne&lt;br /&gt;
&lt;br /&gt;
Array/Object Types&lt;br /&gt;
  * array (or simple_array)&lt;br /&gt;
  * json&lt;br /&gt;
  * object&lt;br /&gt;
  * binary&lt;br /&gt;
  * blob&lt;br /&gt;
&lt;br /&gt;
Date/Time Types&lt;br /&gt;
  * datetime (or datetime_immutable)&lt;br /&gt;
  * datetimetz (or datetimetz_immutable)&lt;br /&gt;
  * date (or date_immutable)&lt;br /&gt;
  * time (or time_immutable)&lt;br /&gt;
  * dateinterval&lt;br /&gt;
&lt;br /&gt;
Other Types&lt;br /&gt;
  * decimal&lt;br /&gt;
  * guid&lt;br /&gt;
  * json_array&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Field type (enter ? to see all types) [string]:&lt;br /&gt;
 &amp;gt; string&lt;br /&gt;
&lt;br /&gt;
 Field length [255]:&lt;br /&gt;
 &amp;gt; 255&lt;br /&gt;
&lt;br /&gt;
 Can this field be null in the database (nullable) (yes/no) [no]:&lt;br /&gt;
 &amp;gt; no&lt;br /&gt;
&lt;br /&gt;
 updated: src/Entity/Application.php&lt;br /&gt;
&lt;br /&gt;
 Add another property? Enter the property name (or press &amp;lt;return&amp;gt; to stop adding fields):&lt;br /&gt;
 &amp;gt; alias&lt;br /&gt;
&lt;br /&gt;
 Field type (enter ? to see all types) [string]:&lt;br /&gt;
 &amp;gt; string&lt;br /&gt;
&lt;br /&gt;
 Field length [255]:&lt;br /&gt;
 &amp;gt; 255&lt;br /&gt;
&lt;br /&gt;
 Can this field be null in the database (nullable) (yes/no) [no]:&lt;br /&gt;
 &amp;gt; no&lt;br /&gt;
&lt;br /&gt;
 updated: src/Entity/Application.php&lt;br /&gt;
&lt;br /&gt;
 Add another property? Enter the property name (or press &amp;lt;return&amp;gt; to stop adding fields):&lt;br /&gt;
 &amp;gt; applicationManager&lt;br /&gt;
&lt;br /&gt;
 Field type (enter ? to see all types) [string]:&lt;br /&gt;
 &amp;gt; string&lt;br /&gt;
&lt;br /&gt;
 Field length [255]:&lt;br /&gt;
 &amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Can this field be null in the database (nullable) (yes/no) [no]:&lt;br /&gt;
 &amp;gt; yes&lt;br /&gt;
&lt;br /&gt;
 updated: src/Entity/Application.php&lt;br /&gt;
&lt;br /&gt;
 Add another property? Enter the property name (or press &amp;lt;return&amp;gt; to stop adding fields):&lt;br /&gt;
 &amp;gt; businessManager&lt;br /&gt;
&lt;br /&gt;
 Field type (enter ? to see all types) [string]:&lt;br /&gt;
 &amp;gt; string&lt;br /&gt;
&lt;br /&gt;
 Field length [255]:&lt;br /&gt;
 &amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Can this field be null in the database (nullable) (yes/no) [no]:&lt;br /&gt;
 &amp;gt; yes&lt;br /&gt;
&lt;br /&gt;
 updated: src/Entity/Application.php&lt;br /&gt;
&lt;br /&gt;
 Add another property? Enter the property name (or press &amp;lt;return&amp;gt; to stop adding fields):&lt;br /&gt;
 &amp;gt; company&lt;br /&gt;
&lt;br /&gt;
 Field type (enter ? to see all types) [string]:&lt;br /&gt;
 &amp;gt; string&lt;br /&gt;
&lt;br /&gt;
 Field length [255]:&lt;br /&gt;
 &amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Can this field be null in the database (nullable) (yes/no) [no]:&lt;br /&gt;
 &amp;gt; no&lt;br /&gt;
&lt;br /&gt;
 updated: src/Entity/Application.php&lt;br /&gt;
&lt;br /&gt;
 Add another property? Enter the property name (or press &amp;lt;return&amp;gt; to stop adding fields):&lt;br /&gt;
 &amp;gt; description&lt;br /&gt;
&lt;br /&gt;
 Field type (enter ? to see all types) [string]:&lt;br /&gt;
 &amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Field length [255]:&lt;br /&gt;
 &amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Can this field be null in the database (nullable) (yes/no) [no]:&lt;br /&gt;
 &amp;gt; yes&lt;br /&gt;
&lt;br /&gt;
 updated: src/Entity/Application.php&lt;br /&gt;
&lt;br /&gt;
 Add another property? Enter the property name (or press &amp;lt;return&amp;gt; to stop adding fields):&lt;br /&gt;
 &amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Next: When you're ready, create a migration with make:migration&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Créer une table d'entité ===&lt;br /&gt;
Une fois la classe d'entité créée dans PHP, il faut pouvoir disposer d'une table pour pouvoir stocker les objets de cette classe en base de données. Pour mettre à jour le schéma de la base de données en conséquence, tester dans un premier en simulation la mise à jour avec la commande &amp;lt;code&amp;gt;php bin/console make:migration&amp;lt;/code&amp;gt;. Exemple :&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
[php-fpm@myserver APPLI]$ php bin/console make:migration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Next: Review the new migration &amp;quot;src/Migrations/Version20200116140541.php&amp;quot;&lt;br /&gt;
 Then: Run the migration with php bin/console doctrine:migrations:migrate&lt;br /&gt;
 See https://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Si le test est concluant comme l'exemple ci-dessus, lancer la mise à jour avec la commande &amp;lt;code&amp;gt;php bin/console doctrine:migrations:migrate&amp;lt;/code&amp;gt;. Exemple :&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
[php-fpm@myserver APPLI]$ php bin/console doctrine:migrations:migrate&lt;br /&gt;
&lt;br /&gt;
                    Application Migrations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (y/n)y&lt;br /&gt;
Migrating up to 20200116140541 from 0&lt;br /&gt;
&lt;br /&gt;
  ++ migrating 20200116140541&lt;br /&gt;
&lt;br /&gt;
     -&amp;gt; CREATE TABLE application (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, alias VARCHAR(255) NOT NULL, application_manager VARCHAR(255) DEFAULT NULL, business_manager VARCHAR(255) DEFAULT NULL, company VARCHAR(255) NOT NULL, description VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB&lt;br /&gt;
&lt;br /&gt;
  ++ migrated (took 542,4ms, used 16M memory)&lt;br /&gt;
&lt;br /&gt;
  ------------------------&lt;br /&gt;
&lt;br /&gt;
  ++ finished in 575,6ms&lt;br /&gt;
  ++ used 16M memory&lt;br /&gt;
  ++ 1 migrations executed&lt;br /&gt;
  ++ 1 sql queries&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Créer un contrôleur ===&lt;br /&gt;
Les contrôleurs contiennent le code central de l'application. Ce sont eux qui décident quoi faire des objet, comment traiter les appels et quelles réponses renvoyer. Suite à la création d'une classe d'entité, Doctrine permet la création automatique du contrôleur associé. Pour ce faire, lancer la commande &amp;lt;code&amp;gt;php bin/console make:controller ApplicationController&amp;lt;/code&amp;gt;. Exemple :&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
[php-fpm@myserver APPLI]$ php bin/console make:controller ApplicationController&lt;br /&gt;
&lt;br /&gt;
 created: src/Controller/ApplicationController.php&lt;br /&gt;
 created: templates/application/index.html.twig&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  Success!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Next: Open your new controller class and add some pages!&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Editer le contrôleur nouvellement créé &amp;lt;code&amp;gt;src/Controller/ApplicationController.php&amp;lt;/code&amp;gt; et y ajouter une route permettant l'ajout d'un nouvel enregistrement d'un objet. Exemple :&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
namespace App\Controller;&lt;br /&gt;
&lt;br /&gt;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;&lt;br /&gt;
use Symfony\Component\Routing\Annotation\Route;&lt;br /&gt;
use App\Entity\Application;&lt;br /&gt;
use Doctrine\ORM\EntityManagerInterface;&lt;br /&gt;
use Symfony\Component\HttpFoundation\Response;&lt;br /&gt;
&lt;br /&gt;
class ApplicationController extends AbstractController&lt;br /&gt;
{&lt;br /&gt;
    /**&lt;br /&gt;
     * @Route(&amp;quot;/application&amp;quot;, name=&amp;quot;application&amp;quot;)&lt;br /&gt;
     */&lt;br /&gt;
    public function index()&lt;br /&gt;
    {&lt;br /&gt;
        return $this-&amp;gt;render('application/index.html.twig', [&lt;br /&gt;
            'controller_name' =&amp;gt; 'ApplicationController',&lt;br /&gt;
        ]);&lt;br /&gt;
    }&lt;br /&gt;
	&lt;br /&gt;
    /**&lt;br /&gt;
     * @Route(&amp;quot;/application/add&amp;quot;, name=&amp;quot;add_application&amp;quot;)&lt;br /&gt;
     */&lt;br /&gt;
    public function createApplication(EntityManagerInterface $entityManager): Response&lt;br /&gt;
    {&lt;br /&gt;
        $application = new Application();&lt;br /&gt;
        $application-&amp;gt;setName('MyNewApp');&lt;br /&gt;
        $application-&amp;gt;setAlias('MNA');&lt;br /&gt;
        $application-&amp;gt;setApplicationManager('Michel DUPONT');&lt;br /&gt;
        $application-&amp;gt;setBusinessManager('Philippe TARFTUFFE');&lt;br /&gt;
        $application-&amp;gt;setCompany('Ma petite entreprise');&lt;br /&gt;
&lt;br /&gt;
        $entityManager-&amp;gt;persist($application);&lt;br /&gt;
        $entityManager-&amp;gt;flush();&lt;br /&gt;
&lt;br /&gt;
        return new Response('Saved new application with id '.$application-&amp;gt;getId());&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Pour tester le bon fonctionnement de ce bout de code, se rendre sur l'URL /application/add. Si le test est concluant, le message suivant s'affiche :&lt;br /&gt;
 Saved new application with id 1&lt;br /&gt;
&lt;br /&gt;
Pour vérifier l'enregistrement en base de données, il est possible de faire une requête SQL depuis Doctrine avec la commande &amp;lt;code&amp;gt;php bin/console doctrine:query:sql 'SELECT * FROM application'&amp;lt;/code&amp;gt;. Exemple :&lt;br /&gt;
{{terminal|text=&lt;br /&gt;
[php-fpm@myserver APPLI]$ php bin/console doctrine:query:sql 'SELECT * FROM application'&lt;br /&gt;
array(1) {&lt;br /&gt;
  [0]=&amp;gt;&lt;br /&gt;
  array(7) {&lt;br /&gt;
    [&amp;quot;id&amp;quot;]=&amp;gt;&lt;br /&gt;
    string(1) &amp;quot;1&amp;quot;&lt;br /&gt;
    [&amp;quot;name&amp;quot;]=&amp;gt;&lt;br /&gt;
    string(11) &amp;quot;MyNewApp&amp;quot;&lt;br /&gt;
    [&amp;quot;alias&amp;quot;]=&amp;gt;&lt;br /&gt;
    string(4) &amp;quot;MNA&amp;quot;&lt;br /&gt;
    [&amp;quot;application_manager&amp;quot;]=&amp;gt;&lt;br /&gt;
    string(15) &amp;quot;Michel DUPONT&amp;quot;&lt;br /&gt;
    [&amp;quot;business_manager&amp;quot;]=&amp;gt;&lt;br /&gt;
    string(14) &amp;quot;Philippe TARFTUFFE&amp;quot;&lt;br /&gt;
    [&amp;quot;company&amp;quot;]=&amp;gt;&lt;br /&gt;
    string(15) &amp;quot;Ma petite entreprise&amp;quot;&lt;br /&gt;
    [&amp;quot;description&amp;quot;]=&amp;gt;&lt;br /&gt;
    NULL&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Validation d'objet ===&lt;br /&gt;
Symfony offre la possibilité d'activer une validation simple des objets, se basant sur leur déclaration au travers des annotations Doctrine. Bien que cela ne remplace en rien configuration complète de validation, celle-ci permet d'activer la validation des contraintes suivantes :&lt;br /&gt;
*Ne peut être nul (attribut doctrine &amp;lt;code&amp;gt;nullable=false&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Type (attribut doctrine &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Unique (attribut doctrine &amp;lt;code&amp;gt;unique=true&amp;lt;/code&amp;gt;)&lt;br /&gt;
*Longueur (attribut doctrine &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Pour activer cette simple validation, éditer le fichier &amp;lt;code&amp;gt;config/packages/validator.yaml&amp;lt;/code&amp;gt; et décommenter les lignes suivantes :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;yaml&amp;quot; highlight=7-8&amp;gt;&lt;br /&gt;
framework:&lt;br /&gt;
    validation:&lt;br /&gt;
        email_validation_mode: html5&lt;br /&gt;
&lt;br /&gt;
        # Enables validator auto-mapping support.&lt;br /&gt;
        # For instance, basic validation constraints will be inferred from Doctrine's metadata.&lt;br /&gt;
        auto_mapping:&lt;br /&gt;
            App\Entity\: []&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensuite, dans le contrôleur qui manipule les objets, ajouter la ligne &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; inline&amp;gt;use Symfony\Component\Validator\Validator\ValidatorInterface;&amp;lt;/syntaxhighlight&amp;gt; avant la déclaration de la classe du contrôleur, et ajouter la section suivante pour valider les objets :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; highlight=1,11-14&amp;gt;&lt;br /&gt;
    public function createApplication(EntityManagerInterface $entityManager, ValidatorInterface $validator): Response&lt;br /&gt;
    {&lt;br /&gt;
        $application = new Application();&lt;br /&gt;
        $application-&amp;gt;setName('MyNewApp');&lt;br /&gt;
        $application-&amp;gt;setAlias('MNA');&lt;br /&gt;
        $application-&amp;gt;setApplicationManager('Michel DUPONT');&lt;br /&gt;
        $application-&amp;gt;setBusinessManager('Philippe TARFTUFFE');&lt;br /&gt;
        $application-&amp;gt;setCompany('Ma petite entreprise');&lt;br /&gt;
        $application-&amp;gt;setDescription('toto');&lt;br /&gt;
&lt;br /&gt;
        $errors = $validator-&amp;gt;validate($application);&lt;br /&gt;
        if (count($errors) &amp;gt; 0) {&lt;br /&gt;
            return new Response((string) $errors, 400);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        $entityManager-&amp;gt;persist($application);&lt;br /&gt;
        $entityManager-&amp;gt;flush();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Penser à injecter la classe &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot; inline&amp;gt;ValidatorInterface $validator&amp;lt;/syntaxhighlight&amp;gt; dans la déclaration de la fonction pour injecter la dépendance au service &amp;lt;code&amp;gt;Validator&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Pour plus d'informations et/ou mettre en place une validation plus poussée des objets, se rendre sur [https://symfony.com/doc/current/validation.html la documentation officielle de la validation de Symfony].&lt;br /&gt;
&lt;br /&gt;
=== Récupérer un objet en BDD ===&lt;/div&gt;</summary>
		<author><name>Jordan</name></author>
		
	</entry>
</feed>