Hello,
seams like today is feature request day :) so here goes mine.

I'm using phptal with Doctrine ORM.
Unfortunately Doctrine and phtpal have different understanding about what exactly isset means.
So every time i upgrade phptal i have to apply this little patch.

How do you feel about adding it?

I see two potential issues with it
1. maybe it should be configurable and not enabled by default (queries behind it could be expensive, so it might not be always desired) 2. currently $nothrow dosn't work (should be easily fixed with try/catch block)

--
Ivo

--- Context.php.orig	2010-10-19 11:04:24.000000000 +0300
+++ Context.php	2010-10-19 11:06:07.000000000 +0300
@@ -384,6 +384,13 @@
                         $base = $base->$current;
                         continue;
                     }
+					// handle Doctrine lazy-loading
+					elseif ($base instanceof Doctrine_Record) {
+						if ($base->hasRelation($current)) {
+							$base = $base->$current;
+							continue;
+						}
+					}
                 }
                 // ask __get and discard if it returns null
                 elseif (method_exists($base, '__get')) {
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to