<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>A.J. Brown&#039;s Blog &#187; Doctrine_Query_Where</title> <atom:link href="http://ajbrown.org/blog/tags/doctrine_query_where/feed" rel="self" type="application/rss+xml" /><link>http://ajbrown.org/blog</link> <description>Coding adventures and technology musing for the masses</description> <lastBuildDate>Fri, 26 Mar 2010 17:57:50 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>New Doctrine Patch: BETWEEN relation alias parsing</title><link>http://ajbrown.org/blog/2008/12/30/new-doctrine-patch-between-relation-alias-parsing.html</link> <comments>http://ajbrown.org/blog/2008/12/30/new-doctrine-patch-between-relation-alias-parsing.html#comments</comments> <pubDate>Tue, 30 Dec 2008 21:44:30 +0000</pubDate> <dc:creator>A.J. Brown</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Doctrine ORM]]></category> <category><![CDATA[Doctrine_Query]]></category> <category><![CDATA[Doctrine_Query_Where]]></category><guid isPermaLink="false">http://ajbrown.org/blog/?p=151</guid> <description><![CDATA[Issue BETWEEN clauses with relational alias operands do not parse, resulting in an exception "could not find short alias". Example The following code will throw an exception. User hasOne Subscription. $q1 = Doctrine_Query::create() ->select('u.id') ->from('User u') ->where("CURRENT_DATE() BETWEEN u.Subscription.begin AND u.Subscription.end") ->addWhere( 'u.id != 5' ); Since the between operands are relational aliases, and not [...]]]></description> <content:encoded><![CDATA[<h4 id="toc-issue">Issue</h4><p>BETWEEN clauses with relational alias operands do not parse, resulting in an exception "could not find short alias".</p><h4 id="toc-example">Example</h4><p>The following code will throw an exception.  User hasOne Subscription.</p><pre lang="PHP" line="1">
$q1 = Doctrine_Query::create()
    ->select('u.id') ->from('User u') ->where("CURRENT_DATE() BETWEEN u.Subscription.begin AND u.Subscription.end")
    ->addWhere( 'u.id != 5' );
</pre><p>Since the between operands are relational aliases, and not literals or short aliases, Doctrine does not attempt to parse correctly.  I modified the behavior to do extra parsing on the expressions when BETWEEN is encountered as the operation.</p><h4 id="toc-the-goods">The Goods</h4><ul><li><a href="http://trac.doctrine-project.org/attachment/ticket/1792/fix-parse-between.diff">The Patch</a></li><li><a href="http://trac.doctrine-project.org/ticket/1792">The Ticket</a></li></ul><p>Guilherme from the team messaged me last night to let me know he's going to commit the patch.  I just checked and it's not there yet, so if you need this fix immediately, you can apply the patch above.</p> ]]></content:encoded> <wfw:commentRss>http://ajbrown.org/blog/2008/12/30/new-doctrine-patch-between-relation-alias-parsing.html/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>