<?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>Anna Filina &#187; doctrine</title>
	<atom:link href="http://annafilina.com/blog/tag/doctrine/feed/" rel="self" type="application/rss+xml" />
	<link>http://annafilina.com/blog</link>
	<description>I fix stuff</description>
	<lastBuildDate>Wed, 04 Jan 2012 14:56:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Doctrine Translation in leftJoin()</title>
		<link>http://annafilina.com/blog/doctrine-translation-in-leftjoin/</link>
		<comments>http://annafilina.com/blog/doctrine-translation-in-leftjoin/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 10:51:06 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=467</guid>
		<description><![CDATA[If you use Doctrine, then you probably know how lazy loading can hurt your performance. I carefully craft every query to everything that I need in one shot, but only what I need. One thing that evaded me at first was the i18n part.
Model Relationships
I am pleased with the way Doctrine + symfony magically creates<div><a href="http://annafilina.com/blog/doctrine-translation-in-leftjoin/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<p>If you use Doctrine, then you probably know how <a href="http://en.wikipedia.org/wiki/Lazy_loading">lazy loading</a> can hurt your performance. I carefully craft every query to everything that I need in one shot, but only what I need. One thing that evaded me at first was the <a href="http://en.wikipedia.org/wiki/I18n">i18n</a> part.</p>
<h3>Model Relationships</h3>
<p>I am pleased with the way <a href="http://www.doctrine-project.org">Doctrine</a> + <a href="http://www.symfony-project.org">symfony</a> magically creates all my models and database tables with i18n support. All my relationship names are explicitly defined in the schema.yml file. So, if I want to get all products in a transaction, I can access it via $transaction-&gt;Products. When crafting a query, I would say -&gt;leftJoin(&#8216;t.Products&#8217;) to make sure to load all the products at the same time as the transaction, potentially saving hundreds of queries later.</p>
<h3>I18n</h3>
<p>Since the i18n relationship is defined in a special way in schema.yml, without specifying a relationship name, I wasn&#8217;t sure how to write my Left Join. I looked up the Base[ClassName].class.php file but did not find anything useful. After analyzing all the parent classes, I found it: Translation. It might have seem obvious since the tables are names product_translation, but that element eluded me and I did not find anything in the documentation at the time regarding this.</p>
<h3>Other uses</h3>
<p>Now that I can get my product names with -&gt;leftJoin(&#8216;p.Translation&#8217;), I cut the number of queries in at least two. Knowing the Translation relationship can have other uses, like counting the number of translations in your code and warning the user about missing translations (no product name in French!). I can also use the Translation relationship to make my search-engine friendly URLs multilingual. I can write about this last one in another post if I get such a request.</p>
<p>The uses for the Translation relationship are infinite!</p>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/doctrine-translation-in-leftjoin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>doctrine:insert-sql for MAMP users</title>
		<link>http://annafilina.com/blog/doctrine-and-mamp/</link>
		<comments>http://annafilina.com/blog/doctrine-and-mamp/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 01:51:55 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[mac os]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=319</guid>
		<description><![CDATA[One of my computers has MAMP installed. I was trying to build a database schema from a YAML file. When time came to insert the SQL using&#8230;
&#62;php symfony doctrine:insert-sql
the following error message appeared:
&#62;Couldn&#8217;t locate driver named mysql
MySQL worked fine on this computer for many years so a missing driver was out of the question. After<div><a href="http://annafilina.com/blog/doctrine-and-mamp/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<p>One of my computers has MAMP installed. I was trying to build a database schema from a YAML file. When time came to insert the SQL using&#8230;</p>
<p>&gt;php symfony doctrine:insert-sql</p>
<p>the following error message appeared:</p>
<p>&gt;Couldn&#8217;t locate driver named mysql</p>
<p>MySQL worked fine on this computer for many years so a missing driver was out of the question. After some thinking I realized that the command &#8220;php&#8221; actually refers to OS X version of php and not the one that ships with MAMP. Since I was too lazy to properly configure the extensions for the OS X version, I simply pointed the &#8220;php&#8221; command to the MAMP version using the following line:</p>
<p>&gt;alias php=&#8217;/Applications/MAMP/bin/php5/bin/php&#8217;</p>
<p>I ran the symfony command again and it worked perfectly!</p>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/doctrine-and-mamp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

