<?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; propel</title>
	<atom:link href="http://www.entwicklungsgedanken.de/tag/propel/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>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>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>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>
