Author: francois
Date: 2010-05-05 11:36:46 +0200 (Wed, 05 May 2010)
New Revision: 29352

Modified:
   plugins/sfPropel15Plugin/trunk/doc/schema.txt
Log:
[sfPropel15Plugin] Documented the isCrossRef table attributes for the YAML 
schema

Modified: plugins/sfPropel15Plugin/trunk/doc/schema.txt
===================================================================
--- plugins/sfPropel15Plugin/trunk/doc/schema.txt       2010-05-04 23:24:33 UTC 
(rev 29351)
+++ plugins/sfPropel15Plugin/trunk/doc/schema.txt       2010-05-05 09:36:46 UTC 
(rev 29352)
@@ -205,6 +205,34 @@
 
 The alternative syntax is useful only for indexes built on more than one 
column.
 
+Many-to-Many relationships
+--------------------------
+
+Cross-reference tables, used for many-to-many relationships, must declare with 
an `isCrossRef` attribute set to `true`:
+
+    [yml]
+    propel:
+      blog_article:
+        # columns definition
+      
+      blog_author:
+        # columns definition
+      
+      blog_article_author:
+        _attributes: { phpName: ArticleAuthor, isCrossRef: true }
+        article_id:  { type: integer, foreignTable: blog_article, 
foreignReference: id, onDelete: cascade }
+        author_id:   { type: integer, foreignTable: blog_author, 
foreignReference: id, onDelete: cascade }
+
+Declaring a table as a cross reference table leads Propel to generate more 
methods in the Model and Query classes, including:
+
+    [php]
+    Article::getAuthors()
+    Article::countAuthors()
+    ArticleQuery::filterByAuthor($author)
+    Author::getArticles()
+    Author::countArticles()
+    AuthorQuery::filterByArticle($article)
+    
 I18n Tables
 -----------
 

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to