<?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>entwicklungsgedanken &#187; Symfony</title>
	<atom:link href="http://www.entwicklungsgedanken.de/category/webdevelopment/symfony/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.entwicklungsgedanken.de</link>
	<description>Verschiedene Gedanken rund um die Softwareentwicklung</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:09:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Configure the symfony-mailer (swiftmailer) during runtime</title>
		<link>http://www.entwicklungsgedanken.de/2010/05/03/configure-the-symfony-mailer-swiftmailer-during-runtime/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/05/03/configure-the-symfony-mailer-swiftmailer-during-runtime/#comments</comments>
		<pubDate>Mon, 03 May 2010 08:45:32 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[mailer]]></category>
		<category><![CDATA[multi-client]]></category>
		<category><![CDATA[runtime]]></category>
		<category><![CDATA[swiftmailer]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=413</guid>
		<description><![CDATA[One of my current projects is a multi-client environment. Each client has its own smtp-settings for the mailings that are done within that application. From static &#8230; Symfony allows the configuration of the mailer in its factories.yml. There smtp-settings can be definied. But in this case this is impossible as every client has different smtp-settings [...]]]></description>
			<content:encoded><![CDATA[<p>One of my current projects is a multi-client environment. Each client has its own smtp-settings for the mailings that are done within that application.</p>
<h3>From static &#8230;</h3>
<p>Symfony allows the configuration of the mailer in its <code>factories.yml</code>. There smtp-settings can be definied. But in this case this is impossible as every client has different smtp-settings (every client can use its own smtp-settings to handle mailings).</p>
<p>As I did not want to create an instance of the <a href="http://swiftmailer.org/">Swift_Mailer</a> (and<a href="http://swiftmailer.org/docs/smtp-transport"> Swift_SmtpTransport</a>) myself I decided to create my own mailer-class which is derived from the symfony one. So I get the full benefits of logging.</p>
<h3>&#8230; to dynamic</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> myDynamicMailer <span style="color: #000000; font-weight: bold;">extends</span> sfMailer
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span>sfEventDispatcher <span style="color: #000088;">$dispatcher</span><span style="color: #339933;">,</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Load client based configuration</span>
    <span style="color: #000088;">$cfg</span> <span style="color: #339933;">=</span> EmailConfiguration<span style="color: #339933;">::</span><span style="color: #004000;">getCurrent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>isSmtpConfigured<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;class&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Swift_MailTransport&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// Update settings for the current client</span>
      <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;transport&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;param&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;host&quot;</span><span style="color: #009900;">&#93;</span>      <span style="color: #339933;">=</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getHostname<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;transport&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;param&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;port&quot;</span><span style="color: #009900;">&#93;</span>      <span style="color: #339933;">=</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getPort<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;transport&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;param&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getUsername<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;transport&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;param&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getDecryptedPassword<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dispatcher</span><span style="color: #339933;">,</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Simply update <code>factories.yml</code> with the new class and the dynamic configuration is applied.</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">all:
  mailer:
    class: myDynamicMailer
    # Rest follows here</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/05/03/configure-the-symfony-mailer-swiftmailer-during-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Its time to change the orm</title>
		<link>http://www.entwicklungsgedanken.de/2009/09/05/its-time-to-change-the-orm/</link>
		<comments>http://www.entwicklungsgedanken.de/2009/09/05/its-time-to-change-the-orm/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 12:25:15 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[dead]]></category>
		<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[propel]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=347</guid>
		<description><![CDATA[I attended the great symfony day 09 in cologne yesterday. It was an awesome conference with nice people, interesting talks and discussions. Propel is dead One thing got crystal clear during the talks. Propel is dead! In the next version 1.3 of symfony Doctrine will be the default orm. If thats not a hint &#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>I attended the great <a href="http://www.symfonyday.com/en/">symfony day 09</a> in cologne yesterday. It was an awesome conference with nice people, interesting talks and discussions.</p>
<h3>Propel is dead</h3>
<p>One thing got crystal clear during the talks. <strong>Propel is dead!</strong> In the next version 1.3 of symfony <a href="http://www.doctrine-project.org/">Doctrine</a> will be the default orm. If thats not a hint &#8230; In symfony 2.0 Propel will be deprecated. Additionally the &#8220;leader of Propel&#8221; <a href="http://groups.google.com/group/propel-development/browse_thread/thread/60621ae4e539145d/829895b081ec7873#829895b081ec7873">stated out</a> that he is no longer leading Propel.</p>
<p>So its time to move to Doctrine. The new features in Doctrine 1.2 described by<a href="http://www.jwage.com/"> Jonathan Wage</a> are quite nice. And Doctrine 2.0 will be even more impressive.</p>
<p>Sadly it will require a lot of work rewriting Propel &#8220;criteria queries&#8221; with Doctrine&#8217;s <a href="http://www.doctrine-project.org/documentation/manual/1_1/en/dql-doctrine-query-language">DQL-queries</a>. But I&#8217;m certain that this step makes my applications future prove.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2009/09/05/its-time-to-change-the-orm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problems with default values in Propel</title>
		<link>http://www.entwicklungsgedanken.de/2008/12/05/problems-with-default-values-in-propel/</link>
		<comments>http://www.entwicklungsgedanken.de/2008/12/05/problems-with-default-values-in-propel/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 13:11:46 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[default values]]></category>
		<category><![CDATA[modified]]></category>
		<category><![CDATA[propel]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=116</guid>
		<description><![CDATA[Default values rule! I&#8217;m using Propel 1.2 (an upgrade will be done soon) but for other people out there &#8230; Consider the following declaration-fragment for the &#8220;Foo-entity&#8221;. Nothing special here. &#60;column name=&#34;name&#34; type=&#34;VARCHAR&#34; size=&#34;32&#34; required=&#34;true&#34; /&#62; &#60;column name=&#34;culture&#34; type=&#34;CHAR&#34; size=&#34;5&#34; required=&#34;true&#34; default=&#34;de_DE&#34; /&#62; Now if we create the new object and show the state (var_dump) [...]]]></description>
			<content:encoded><![CDATA[<h3>Default values rule!</h3>
<p>I&#8217;m using Propel 1.2 (an upgrade will be done soon) but for other people out there &#8230;</p>
<p>Consider the following declaration-fragment for the &#8220;Foo-entity&#8221;. Nothing special here.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;VARCHAR&quot;</span> <span style="color: #000066;">size</span>=<span style="color: #ff0000;">&quot;32&quot;</span> <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;culture&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;CHAR&quot;</span> <span style="color: #000066;">size</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;de_DE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Now if we create the new object and show the state (<code>var_dump</code>) of the object the <code>culture</code>-field is set to &#8216;de_DE&#8217; which is correct.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$inst</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Foo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$inst</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Foobar'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$inst</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">save</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>But if you look in your (debug-)logfiles you will see that the <code>insert-query</code> will be generated as:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> foo <span style="color: #66cc66;">&#40;</span>NAME<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Foobar'</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<h3>Where is the value for the culture column?</h3>
<p>Propel keeps track of the modified columns to reduce the size of the <code>update/insert-queries</code>. The default values for the object will not be set through the generated class-methods. Instead the default values are directly assgined in the member-variable of the generated class. So Propel is unaware that the values has changed.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">protected <span style="color: #000088;">$culture</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'de_DE'</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Conclusion</h3>
<p>I don&#8217;t know if this bug is fixed in Propel 1.3. Soon I will know &#8230;</p>
<p>As I will continue working with Propel 1.2 in the current project the &#8220;workaround&#8221; is to manually set the culture. This is best done in the constructor of your derived class. So Propel knows that the column is modified.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Foo <span style="color: #000000; font-weight: bold;">extends</span> BaseFoo
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
     <span style="color: #666666; font-style: italic;">// Note: The generated base-class does not have a constructor</span>
     <span style="color: #666666; font-style: italic;">// so parent::__construct will fail!</span>
     <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setCulture</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCulture</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2008/12/05/problems-with-default-values-in-propel/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Translating the sfAssetLibraryPlugin using gettext instead of XLIFF</title>
		<link>http://www.entwicklungsgedanken.de/2008/10/31/translating-the-sfassetlibraryplugin-using-gettext-instead-of-xliff/</link>
		<comments>http://www.entwicklungsgedanken.de/2008/10/31/translating-the-sfassetlibraryplugin-using-gettext-instead-of-xliff/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 17:25:54 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[I18N]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[sfAssetLibrary]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=70</guid>
		<description><![CDATA[I&#8217;m using the sfAssetLibraryPlugin in one of my active projects. This project uses gettext for interface translation. The plugin ships with XLIFF-files for interface translation. In order to get gettext working simply create the required directories inside the plugin-directory (plugins/sfAssetLibraryPlugin/modules/sfAsset/i18n) and create a new catalog for each language (de, en, fr, ...). The important thing [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using the <a href="http://www.symfony-project.org/plugins/sfAssetsLibraryPlugin">sfAssetLibraryPlugin</a> in one of my active projects. This project uses <a href="http://de.wikipedia.org/wiki/GNU_gettext">gettext</a> for interface translation.</p>
<p>
The plugin ships with <a href="http://de.wikipedia.org/wiki/XLIFF">XLIFF</a>-files for interface translation. In order to get gettext working simply create the required directories inside the plugin-directory (<code>plugins/sfAssetLibraryPlugin/modules/sfAsset/i18n</code>) and create a new catalog for each language (<code>de, en, fr, ...</code>).
</p>
<p>The important thing here is to take care of the &#8220;translation-namespace&#8221; the plugin uses (<code>sfAsset</code> in this case).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Description'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sfAsset'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><div id="attachment_83" class="wp-caption alignleft" style="width: 217px"><a href="http://www.entwicklungsgedanken.de/wp-content/uploads/2008/10/sfasset-gettext.png"><img src="http://www.entwicklungsgedanken.de/wp-content/uploads/2008/10/sfasset-gettext-207x300.png" alt="Directory layout" title="sfasset-gettext" height="250" class="size-medium wp-image-83" /></a><p class="wp-caption-text">Directory layout of the sfAssetLibraryPlugin</p></div><br />
So your gettext-catalog-file has to be named <code>sfAsset.po</code> and not <code>message.po</code> as one could think when reading in the <a href="http://trac.symfony-project.org/wiki/HowToUseI18NWithGettext">symfony-wiki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2008/10/31/translating-the-sfassetlibraryplugin-using-gettext-instead-of-xliff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL-Join with multiple conditions when using Propel</title>
		<link>http://www.entwicklungsgedanken.de/2008/09/03/sql-join-with-multiple-conditions-when-using-propel/</link>
		<comments>http://www.entwicklungsgedanken.de/2008/09/03/sql-join-with-multiple-conditions-when-using-propel/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 19:12:52 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[Multiple]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[SQL-Join]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=64</guid>
		<description><![CDATA[Propels (Creole) &#8220;criteria infrastructure&#8221; is a great speed-up for the development process and makes it easy to &#8220;write&#8221; queries. However if you are forced to create a SQL-Join which requires multiple join-conditions the criteria-api is not a helper anymore. In order to make use of the criteria-api even in this case a &#8220;hack&#8221; can be [...]]]></description>
			<content:encoded><![CDATA[</p>
<p><a href="http://propel.phpdb.org/trac/">Propels</a> (Creole) &#8220;<a href="http://propel.phpdb.org/trac/wiki/Users/Documentation/1.3/Criteria">criteria infrastructure</a>&#8221; is a great speed-up for the development process and makes it easy to &#8220;write&#8221; queries. However if you are forced to create a SQL-Join which requires multiple join-conditions the criteria-api is not a helper anymore.</p>
<p>
In order to make use of the criteria-api even in this case a &#8220;hack&#8221; can be used. <a href="http://stereointeractive.com/blog/2007/05/12/left-joins-with-multiple-conditions-using-propel-criteria/">Someone else</a> described it in a blog-post.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Criteria<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addJoin</span><span style="color: #009900;">&#40;</span>Object1Peer<span style="color: #339933;">::</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> Object2Peer<span style="color: #339933;">::</span><span style="color: #004000;">ID</span> <span style="color: #339933;">.</span>
  <span style="color: #0000ff;">' AND '</span> <span style="color: #339933;">.</span> Object1Peer<span style="color: #339933;">::</span><span style="color: #004000;">LOCALE</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' = '</span> <span style="color: #339933;">.</span> Object2Peer<span style="color: #339933;">::</span><span style="color: #004000;">LOCALE</span> <span style="color: #339933;">.</span>
  <span style="color: #0000ff;">' AND '</span> <span style="color: #339933;">.</span> Object1Peer<span style="color: #339933;">::</span><span style="color: #004000;">WHATEVER</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' = '</span> <span style="color: #339933;">.</span> Object2Peer<span style="color: #339933;">::</span><span style="color: #004000;">WHATEVER</span><span style="color: #339933;">,</span>
  Criteria<span style="color: #339933;">::</span><span style="color: #990000;">JOIN</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>
Its a &#8220;hack&#8221; but you are not required to write the whole sql-query on your own and can rely on the criteria-api.
</p>
<p>
As I found out the Propel-developers are <a href="http://propel.phpdb.org/trac/ticket/167#comment:13">aware of this problem</a> and a solution is planned for the (hopefully soon) next Propel release 1.4.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2008/09/03/sql-join-with-multiple-conditions-when-using-propel/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Problems with Internet Explorer and application/json</title>
		<link>http://www.entwicklungsgedanken.de/2008/06/06/problems-with-internet-explorer-and-applicationjson/</link>
		<comments>http://www.entwicklungsgedanken.de/2008/06/06/problems-with-internet-explorer-and-applicationjson/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 13:53:10 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[mime-type]]></category>
		<category><![CDATA[save as]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=49</guid>
		<description><![CDATA[My current project based on Symfony and YUI was developed using Firefox (and its great plugin Firebug) and Safari. It made heavy use of JSON. My Symfony action looked like public function executeSomething &#40;&#41; &#123; $this-&#62;getResponse &#40;&#41;-&#62;setHttpHeader &#40;'Content-Type', 'application/json'&#41;; // ... Do something return $this-&#62;renderText &#40;$myJsonCode&#41;; &#125; Nothing spectacular. This code works with Opera, Firefox [...]]]></description>
			<content:encoded><![CDATA[<p>My current project based on <a href="http://www.symfony-project.org">Symfony</a> and <a href="http://developer.yahoo.com/yui/">YUI</a> was developed using Firefox (and its great plugin <a href="http://www.getfirebug.com/">Firebug</a>) and Safari. It made heavy use of JSON. My Symfony action looked like</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> executeSomething <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponse</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setHttpHeader</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'application/json'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// ... Do something</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">renderText</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$myJsonCode</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Nothing spectacular. This code works with Opera, Firefox and Safari. The <code>application/json</code> is the official <a href="http://tools.ietf.org/html/rfc4627">Mime-Type</a> for JSON.</p>
<h3>Save as &#8230; </h3>
<p>If you call this action via your JavaScript-code with the famous Internet Explorer (IE7 in this case) the &#8220;Save as &#8230;&#8221; &#8211; dialog appears and IE wants me to save a file! What?!</p>
<h3>Workaround</h3>
<p>The reason behind this is that Internet Explorer cannot associate the <code>application/json</code> Mime-Type to an application installed on the client-side.<br />
To get around this simply use <code>text/javascript</code> as <code>Content-Type</code> inside Symfony.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> executeSomething <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponse</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setHttpHeader</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'text/javascript'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// ... Do something</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">renderText</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$myJsonCode</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>Conclusion</h3>
<p>I love IE!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2008/06/06/problems-with-internet-explorer-and-applicationjson/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Performance increase when using case-insensitive queries with Symfony, Propel and PostgreSQL</title>
		<link>http://www.entwicklungsgedanken.de/2008/01/24/performance-increase-when-using-case-insensitive-queries-with-symfony-propel-and-postgresql/</link>
		<comments>http://www.entwicklungsgedanken.de/2008/01/24/performance-increase-when-using-case-insensitive-queries-with-symfony-propel-and-postgresql/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 10:39:25 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[case-insensitive]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[propel]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/2008/01/24/performance-increase-when-using-case-insensitive-queries-with-symfony-propel-and-postgresql/</guid>
		<description><![CDATA[Symfony makes heavy use of Propel. Propel finds objects in the storage container using criteria. If you want to let Propel (okay the database) ignore the case you can set this in the criteria. $c = new Criteria &#40;&#41;; &#160; // Allow case sensitive searches $c-&#62;setIgnoreCase &#40;true&#41;; &#160; // Find all posts which name contains [...]]]></description>
			<content:encoded><![CDATA[<div class="lang-en"></div>
<p><a href="http://www.symfony-project.org/" class="external">Symfony</a> makes heavy use of <a href="http://propel.phpdb.org/trac/" class="external">Propel</a>. Propel finds objects in the storage container using criteria. If you want to let Propel (okay the database) ignore the case you can set this in the criteria.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Criteria <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Allow case sensitive searches</span>
<span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setIgnoreCase</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Find all posts which name contains propel</span>
<span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add</span> <span style="color: #009900;">&#40;</span>BlogPostPeer<span style="color: #339933;">::</span><span style="color: #004000;">NAME</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Propel'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$posts</span> <span style="color: #339933;">=</span> BlogPostPeer<span style="color: #339933;">::</span><span style="color: #004000;">doSelect</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Because PostgreSQL (unlike MySQL) does not support collations to easily manage how comparisons of strings are done Propel has to generate this sql-statement.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> blog_posts<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">,</span> blog_posts<span style="color: #66cc66;">.</span>date
<span style="color: #993333; font-weight: bold;">FROM</span> blog_posts
<span style="color: #993333; font-weight: bold;">WHERE</span> UPPER<span style="color: #66cc66;">&#40;</span>blog_posts<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'PROPEL'</span>;</pre></div></div>

<p>Depending on your amount of data this can become <strong>very slow</strong> even if you have an index defined for the &quot;name&quot;-column.</p>
<p>
The trick is to create <em>another index</em> for the column &quot;name&quot;.
</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">INDEX</span> <span style="color: #ff0000;">&quot;UpperNameIndex&quot;</span> <span style="color: #993333; font-weight: bold;">ON</span> blog_posts <span style="color: #993333; font-weight: bold;">USING</span> BTREE <span style="color: #66cc66;">&#40;</span>UPPER<span style="color: #66cc66;">&#40;</span>name<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Thats it. When now using <code>setIgnoreCase</code> its fast again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2008/01/24/performance-increase-when-using-case-insensitive-queries-with-symfony-propel-and-postgresql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
