<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://www.wiki.gioo.info/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
		<id>https://www.wiki.gioo.info/index.php?action=history&amp;feed=atom&amp;title=Symfony_Propel</id>
		<title>Symfony Propel - Historique des versions</title>
		<link rel="self" type="application/atom+xml" href="https://www.wiki.gioo.info/index.php?action=history&amp;feed=atom&amp;title=Symfony_Propel"/>
		<link rel="alternate" type="text/html" href="https://www.wiki.gioo.info/index.php?title=Symfony_Propel&amp;action=history"/>
		<updated>2026-04-10T13:19:23Z</updated>
		<subtitle>Historique pour cette page sur le wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>https://www.wiki.gioo.info/index.php?title=Symfony_Propel&amp;diff=37&amp;oldid=prev</id>
		<title>Gio : Page créée avec « Cet article a été créé suite au passage de Propel à Doctrine pour mon utilisation de Symfony.  Il permet de conserver les différentes étapes différentes par rapport ... »</title>
		<link rel="alternate" type="text/html" href="https://www.wiki.gioo.info/index.php?title=Symfony_Propel&amp;diff=37&amp;oldid=prev"/>
				<updated>2010-12-29T01:15:24Z</updated>
		
		<summary type="html">&lt;p&gt;Page créée avec « Cet article a été créé suite au passage de Propel à Doctrine pour mon utilisation de Symfony.  Il permet de conserver les différentes étapes différentes par rapport ... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Cet article a été créé suite au passage de Propel à Doctrine pour mon utilisation de Symfony.&lt;br /&gt;
&lt;br /&gt;
Il permet de conserver les différentes étapes différentes par rapport à l'utilisation de Doctrine.&lt;br /&gt;
&lt;br /&gt;
== Exemple de création d'une application simple ==&lt;br /&gt;
Dans cet exemple, nous allons créer un petit forum avec deux tables.&lt;br /&gt;
&lt;br /&gt;
=== Faire son schéma de base de donnée ===&lt;br /&gt;
Premièrement, nous allons créer le fichier config/schema.yml&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
propel:&lt;br /&gt;
  forum_topic:&lt;br /&gt;
    id:             ~&lt;br /&gt;
    title:          { type: varchar(255), required: true }&lt;br /&gt;
    body:           { type: longvarchar }&lt;br /&gt;
    created_at:     ~&lt;br /&gt;
  forum_post:&lt;br /&gt;
    id:             ~&lt;br /&gt;
    forum_topic_id: ~&lt;br /&gt;
    title:          { type: varchar(255), required: false }&lt;br /&gt;
    body:           { type: longvarchar }&lt;br /&gt;
    created_at:     ~&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Le ~ est un symbole magique de Symfony. Il correspond à une primary key (int) autoincrement par défaut.&lt;br /&gt;
&lt;br /&gt;
Dans cet exemple, si le nom de la colonne est created_at ou updated_at, le symbole ~ correspond à un timestamp.&lt;br /&gt;
&lt;br /&gt;
Et dans le dernier cas, notre colonne forum_topic_id est une clé étrangère de la table forum_topic grâce au symbole ~.&lt;br /&gt;
&lt;br /&gt;
Plus d'informations ici : http://www.symfony-project.org/book/1_2/08-Inside-the-Model-Layer#chapter_08_sub_empty_columns&lt;br /&gt;
&lt;br /&gt;
=== Créer magiquement les pages associées à notre schéma ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
php symfony propel:build-model&lt;br /&gt;
php symfony propel:build-sql&lt;br /&gt;
php symfony propel:insert-sql #Une erreur est affichée lors de la première insertion car il essaye de dropper des tables inexistantes&lt;br /&gt;
php symfony propel:build-forms&lt;br /&gt;
php symfony propel:generate-module --non-verbose-templates --with-show frontend topic ForumTopic&lt;br /&gt;
php symfony propel:generate-module --non-verbose-templates frontend post ForumPost&lt;br /&gt;
php symfony cache:clear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gio</name></author>	</entry>

	</feed>