Author: francois
Date: 2010-05-11 10:39:00 +0200 (Tue, 11 May 2010)
New Revision: 29411

Modified:
   plugins/sfPropel15Plugin/trunk/lib/behavior/SfPropelBehaviorI18n.php
Log:
[sfPropel15Plugin] Fixed issue when combining single table inheritance with 
symfony i18n (closes #8480)

Modified: plugins/sfPropel15Plugin/trunk/lib/behavior/SfPropelBehaviorI18n.php
===================================================================
--- plugins/sfPropel15Plugin/trunk/lib/behavior/SfPropelBehaviorI18n.php        
2010-05-11 07:00:16 UTC (rev 29410)
+++ plugins/sfPropel15Plugin/trunk/lib/behavior/SfPropelBehaviorI18n.php        
2010-05-11 08:39:00 UTC (rev 29411)
@@ -233,6 +233,15 @@
 
 EOF;
 
+    if ($this->getTable()->getChildrenColumn())
+    {
+      $newObject = "\$cls = 
{$this->getTable()->getPhpName()}Peer::getOMClass(\$row, 0, false)";
+    }
+    else
+    {
+      $newObject = "\$cls = 
{$this->getTable()->getPhpName()}Peer::getOMClass(false)";
+    }
+    
     return <<<EOF
 
 /**
@@ -285,7 +294,7 @@
                // See http://propel.phpdb.org/trac/ticket/509
                // \$obj1->hydrate(\$row, 0, true); // rehydrate
        } else {
-                       \$cls = 
{$this->getTable()->getPhpName()}Peer::getOMClass(false);
+                       {$newObject};
                        \$obj1 = new \$cls();
                        \$obj1->hydrate(\$row);
       {$this->getTable()->getPhpName()}Peer::addInstanceToPool(\$obj1, \$key1);

-- 
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