<?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>ActiveCodeline &#187; Doctrine ORM</title>
	<atom:link href="http://activecodeline.com/tag/doctrine-orm/feed" rel="self" type="application/rss+xml" />
	<link>http://activecodeline.com</link>
	<description>Blog site of Branko Ajzele, web application developer.</description>
	<lastBuildDate>Tue, 07 Sep 2010 05:59:18 +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>Simple TODO application in Zend Framework and Doctrine ORM</title>
		<link>http://activecodeline.com/simple-todo-application-in-zend-framework-and-doctrine-orm</link>
		<comments>http://activecodeline.com/simple-todo-application-in-zend-framework-and-doctrine-orm#comments</comments>
		<pubDate>Sat, 02 May 2009 16:57:29 +0000</pubDate>
		<dc:creator>branko</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Doctrine ORM]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://activecodeline.com/?p=670</guid>
		<description><![CDATA[I wrote a little TODO application in Zend Framework (1.8) and Doctrine ORM (1.1). I&#8217;m posting it more as a sample (practice) app for Zend and Doctrine newcomers. Entire process of adding, deleting and editing TODO&#8217;s is AJAX based. I used jQuery and Jeditable plugin for it. jQuery and Jeditable plugins are provided in this [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a little TODO application in Zend Framework (1.8) and Doctrine ORM (1.1). I&#8217;m posting it more as a sample (practice) app for Zend and Doctrine newcomers. Entire process of adding, deleting and editing TODO&#8217;s is AJAX based. I used jQuery and Jeditable plugin for it. jQuery and Jeditable plugins are provided in this zip-ed archive. You should download Zend Framework and Doctrine ORM yourself, and place them in appropriate directory. Set the PHP include path to point to that directory.<span id="more-670"></span></p>
<p>Important thing to keep in mind. Few days ago, Zend Framework 1.8 came out. It uses different auto loading approach. I did not had time to study it in detail so some things in /public/index.php file might look out of order. The parts where I auto-loaded Doctrine and models directory. Don&#8217;t worry, it&#8217;s working either way <img src='http://activecodeline.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  What you SHOULD do is CHANGE THE INCLUDE PATH line 28 of the index.php file to reflect your machine path to library folder.</p>
<p>Here are some screenshot of my final application:</p>
<p><a href="http://activecodeline.com/wp-content/uploads/2009/05/toody_example_todo_app_screenshot.jpg"><img src="http://activecodeline.com/wp-content/uploads/2009/05/toody_example_todo_app_screenshot-300x183.jpg" alt="toody_example_todo_app_screenshot" title="toody_example_todo_app_screenshot" width="300" height="183" class="alignnone size-medium wp-image-671" /></a></p>
<p><a href="http://activecodeline.com/wp-content/uploads/2009/05/toody_inline_edit.png"><img src="http://activecodeline.com/wp-content/uploads/2009/05/toody_inline_edit-300x178.png" alt="toody_inline_edit" title="toody_inline_edit" width="300" height="178" class="alignnone size-medium wp-image-672" /></a></p>
<p><a href="http://activecodeline.com/wp-content/uploads/2009/05/toody_inline_edit2.png"><img src="http://activecodeline.com/wp-content/uploads/2009/05/toody_inline_edit2-300x186.png" alt="toody_inline_edit2" title="toody_inline_edit2" width="300" height="186" class="alignnone size-medium wp-image-673" /></a></p>
<p>Here is the screenshot of my library folder</p>
<p><a href="http://activecodeline.com/wp-content/uploads/2009/05/my_library_path.png"><img src="http://activecodeline.com/wp-content/uploads/2009/05/my_library_path-300x206.png" alt="my_library_path" title="my_library_path" width="300" height="206" class="alignnone size-medium wp-image-676" /></a></p>
<p><a href='http://activecodeline.com/wp-content/uploads/2009/05/toody_all.zip'>DOWNLOAD toody</a> (need to download Zend Framework and Doctrine ORM separatly).</p>
<p>Took me around 3 and a half hour to write the app, take the screenshots and write this post. Therefore, use it only in education purpose, cause there is much more to be done to use it for real.</p>
]]></content:encoded>
			<wfw:commentRss>http://activecodeline.com/simple-todo-application-in-zend-framework-and-doctrine-orm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doctrine ORM, data validation</title>
		<link>http://activecodeline.com/doctrine-orm-data-validation</link>
		<comments>http://activecodeline.com/doctrine-orm-data-validation#comments</comments>
		<pubDate>Sat, 25 Apr 2009 10:38:47 +0000</pubDate>
		<dc:creator>branko</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Doctrine ORM]]></category>

		<guid isPermaLink="false">http://activecodeline.com/?p=634</guid>
		<description><![CDATA[User input validation in todays modern web applications plays extremely important role. Simply put, it&#8217;s better to have no data at all then corrupted one. I do a lot of Magento development and I must say I like it&#8217;s front-end JavaScript validation. I&#8217;ve seen a lot of JavaScript validation so far and most of them [...]]]></description>
			<content:encoded><![CDATA[<p>User input validation in todays modern web applications plays extremely important role. Simply put, it&#8217;s better to have no data at all then corrupted one. I do a lot of Magento development and I must say I like it&#8217;s front-end JavaScript validation. I&#8217;ve seen a lot of JavaScript validation so far and most of them turn to be overkill in setup. In Magento you simply assign a class like &#8220;required-entry text&#8221; and you are done. However, JavaScript validation covers only the client side. The server side, the one that&#8217;s more important for data integrity, needs to be validated more carefully and with security in mind. Everyone knows JavaScript can be altered and classes from elements can be removed so there is no guarantee that the validation will even be triggered on client side.<span id="more-634"></span></p>
<p>Anyhow, to keep it short here is a great way to boost your data validation with Doctrine ORM. You simply turn on the appropriate attribute. In case of validation and data integrity we need to turn on the <strong>Doctrine::ATTR_VALIDATE</strong> attribute, like:</p>
<p><em>// $conn = Doctrine_Manager::connection(&#8216;mysql://root:developer@localhost/typler&#8217;);</em><br />
<strong><em>$conn->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_ALL);</em></strong></p>
<p>Now every time you try to do a <strong>$object->save()</strong> where you have empty or invalid data that map to your database table you will get <strong>Doctrine_Validator_Exception</strong>. Since exceptions are OOP oriented way of handling errors we can catch that exception and handle errors the way we want. You can use the instance method <strong>Doctrine_Validator_Exception::getInvalidRecords()</strong> for that. Doing so would return an ordinary array with references to all records that did not pass validation.</p>
<p>With Doctrine validation mechanism in place for Server side validation and a minor JavaScript for client side validation you can easily integrate good validation and integrity check in you web application.</p>
<p>I strongly recommend reading the official <a href="http://www.doctrine-project.org/documentation">Doctrine Manual</a> that you can download from Doctrine website. It&#8217;s quite well written. This post is merely a scratch of what you can find in the manual.</p>
]]></content:encoded>
			<wfw:commentRss>http://activecodeline.com/doctrine-orm-data-validation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doctrine ORM, last insert id</title>
		<link>http://activecodeline.com/doctrine-orm-last-insert-id</link>
		<comments>http://activecodeline.com/doctrine-orm-last-insert-id#comments</comments>
		<pubDate>Sat, 25 Apr 2009 09:42:17 +0000</pubDate>
		<dc:creator>branko</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Doctrine ORM]]></category>

		<guid isPermaLink="false">http://activecodeline.com/?p=630</guid>
		<description><![CDATA[I like ORM&#8217;s more that I like pure SQL approach. I&#8217;m not saying pure SQL is bad, not at all. I just like the way ORM&#8217;s enable you to (almost) forget the database part and fully give yourself to OOP stuff. Almost everyone who ever wrote the code that wrote something into the database needed [...]]]></description>
			<content:encoded><![CDATA[<p>I like ORM&#8217;s more that I like pure SQL approach. I&#8217;m not saying pure SQL is bad, not at all. I just like the way ORM&#8217;s enable you to (almost) forget the database part and fully give yourself to OOP stuff. Almost everyone who ever wrote the code that wrote something into the database needed to know what the last insert id was. Let&#8217;s say you need to write down a new entry into some &#8220;adress&#8221; table, an right after the save you need to open that entry for further editing. In such cases you need to know the id, aka the last insert id, of the entry you just wrote to the database.</p>
<p>Doctrine ORM is mostly about objects, so how does Doctrine handle the last inert id for us? Upon <strong>$object->save()</strong> Doctrine sets that objects id property. So to get the last insert id we simply call the <strong>$object->id</strong>. </p>
<p>Keep in mind that by default Doctrine adds &#8220;id&#8221; property to object unless auto generated classes do not hold some other column name for primary field, or you manually assigned one.</p>
]]></content:encoded>
			<wfw:commentRss>http://activecodeline.com/doctrine-orm-last-insert-id/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Doctrine ORM and Zend Framework, blank project</title>
		<link>http://activecodeline.com/doctrine-orm-and-zend-framework-blank-project</link>
		<comments>http://activecodeline.com/doctrine-orm-and-zend-framework-blank-project#comments</comments>
		<pubDate>Mon, 20 Apr 2009 12:13:57 +0000</pubDate>
		<dc:creator>branko</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Doctrine ORM]]></category>

		<guid isPermaLink="false">http://activecodeline.com/?p=617</guid>
		<description><![CDATA[Wrote a little article at Inchoo.net site. Here is direct link: Doctrine ORM and Zend Framework, sample project to get you started (with sample database).]]></description>
			<content:encoded><![CDATA[<p>Wrote a little article at Inchoo.net site. Here is direct link: <a href="http://inchoo.net/zend/doctrine-orm-and-zend-framework-sample-project-to-get-you-started/">Doctrine ORM and Zend Framework, sample project to get you started (with sample database)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://activecodeline.com/doctrine-orm-and-zend-framework-blank-project/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
