<?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>WEBPIRATEN &#187; Propel ORM</title>
	<atom:link href="http://webpiraten.de/index.php/category/mysql/propel-orm/feed/" rel="self" type="application/rss+xml" />
	<link>http://webpiraten.de</link>
	<description>Techblog</description>
	<lastBuildDate>Sun, 05 Feb 2012 12:52:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>der Criteria Builder für Propel ORM Criterias</title>
		<link>http://webpiraten.de/index.php/php/criteria-builder-propel-orm/</link>
		<comments>http://webpiraten.de/index.php/php/criteria-builder-propel-orm/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 12:58:24 +0000</pubDate>
		<dc:creator>sägefisch</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Propel ORM]]></category>
		<category><![CDATA[builder]]></category>
		<category><![CDATA[criteria]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://webpiraten.de/?p=31</guid>
		<description><![CDATA[Die Propel ORM für PHP bedient sich einer eigenen Syntax (Criterias) um Queries zusammenzustellen. Hier gibt es einen Criteria Builder, den man mit Standard SQL füttern kann. Der Criteria Builder konvertiert sodann das eingegebene SQL Statement in ein Propel Criteria. &#8230; <a href="http://webpiraten.de/index.php/php/criteria-builder-propel-orm/">weiterlesen <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://propel.jondh.me.uk/" target="_blank" title="der Criteria Builder für Propel ORM Criterias"><img src="http://webpiraten.de/wp-content/uploads/2009/10/propel_criteria_builder-300x183.png" alt="propel_criteria_builder" title="propel_criteria_builder" width="300" height="183" class="alignleft size-medium wp-image-33" /></a></p>
<p>Die Propel ORM für PHP bedient sich einer eigenen Syntax (Criterias) um Queries zusammenzustellen. </p>
<p>Hier gibt es einen Criteria Builder, den man mit Standard SQL füttern kann.</p>
<p>Der Criteria Builder konvertiert sodann das eingegebene SQL Statement in ein Propel Criteria. </p>
<p>So wird aus diesem kleinen SQL Statement:</p>
<pre class="brush: sql; title: ; notranslate">

SELECT user.*
FROM user
WHERE user.state = 100
AND (user.name = 'user' OR user.email = 'user@domain.tld')
</pre>
<p>diese Propel Criteria:</p>
<pre class="brush: php; title: ; notranslate">

$c = new Criteria();
$crit0 = $c-&gt;getNewCriterion(UserPeer::STATE, 100);
$crit1 = $c-&gt;getNewCriterion(UserPeer::NAME, 'user');
$crit2 = $c-&gt;getNewCriterion(UserPeer::EMAIL, 'user@domain.tld');

// Perform OR at level 1 ($crit1 $crit2 )
$crit1-&gt;addOr($crit2);

// Perform AND at level 0 ($crit0 $crit1 )
$crit0-&gt;addAnd($crit1);

// Remember to change the peer class here for the correct one in your model
$c-&gt;add($crit0);
$result = TablePeer::doSelect($c);

// This loop will of course need to be edited to work
foreach ($result as $obj)
{
	//$val = $obj-&gt;getValue();
}
</pre>
<p>Einen Versuch ist es Wert.</p>
<p><a href="http://propel.jondh.me.uk/" target="_blank" title="der Criteria Builder für Propel ORM Criterias">Hier gehts zum Propel ORM Criteria Builder</a></p>
]]></content:encoded>
			<wfw:commentRss>http://webpiraten.de/index.php/php/criteria-builder-propel-orm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

