<?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>Oxagile Software Development Company Web Application Development Blog &#187; Doctrine</title>
	<atom:link href="http://blog.oxagile.com/tag/doctrine/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.oxagile.com</link>
	<description>Web and Mobile Application Development Services</description>
	<lastBuildDate>Wed, 21 Dec 2011 20:11:04 +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 in a PHP programming</title>
		<link>http://blog.oxagile.com/2008/07/06/doctrine-in-a-php-programming/</link>
		<comments>http://blog.oxagile.com/2008/07/06/doctrine-in-a-php-programming/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 08:58:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming PHP]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[scripts example]]></category>

		<guid isPermaLink="false">http://blog.oxagile.com/?p=73</guid>
		<description><![CDATA[ 
   
Home page: www.doctrine-project.org.  Current version: 1.0.2
Doctrine is a PHP ORM for PHP 5.2.3+ that sits on the top of a powerful PHP. One of its key features is the ability to optionally write database queries in an object oriented SQL-dialect called DQL inspired by Hibernates HQL. This provides web developers [...]]]></description>
			<content:encoded><![CDATA[ 
   <span class = "facebook-like-this" style = "height: px"><iframe src="http://www.facebook.com/plugins/like.php?href=http://blog.oxagile.com/2008/07/06/doctrine-in-a-php-programming/&layout=standard&show_faces=false&width=100%&action=like&colorscheme=light&locale=en_US&font=" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100%px; height:px"></iframe></span><div class="mceTemp"><a href="http://www.doctrine-project.org"><img class="size-full wp-image-84" title="doctrine-logo" src="http://blog.oxagile.com/wp-content/uploads/2008/10/doctrine-logo.gif" border="0" alt="Doctrine" width="151" height="41" /></a></div>
<p>Home page: <a rel="external nofollow" href="http://www.doctrine-project.org">www.doctrine-project.org</a>.  Current version: 1.0.2</p>
<div class="mceTemp">Doctrine is a PHP ORM for PHP 5.2.3+ that sits on the top of a powerful PHP. One of its key features is the ability to optionally write database queries in an object oriented SQL-dialect called DQL inspired by Hibernates HQL. This provides <a href="http://www.oxagile.com">web developers</a> with a powerful alternative to SQL that maintains a maximum flexibility without requiring needless code duplication.</div>
<p>Doctrine requires PHP 5.2.3+. It doesn&#8217;t require any external libraries. For the database function call abstraction Doctrine uses PDO which comes bundled with the PHP official release that you get from <a style="text-decoration: line-through;" rel="external nofollow" href="http://www.php.net">www.php.net</a>.<br />
<span id="more-73"></span><br />
<strong>Doctrine features:</strong></p>
<ul>
<li>Supports: MySQL, SQLite, PostgreSQL, Oracle, Mssql, Firebird and Informix.</li>
<li>Supports result caching with Memcache, APC or SQLite.</li>
<li>Supports import/export with YAML schemas, SQL scripts or existing database.</li>
<li>Has DQL (Doctrine Query Language) it helping users in complex object retrieval.</li>
<li>Supports migration functionality. For making a migration process easy.</li>
<li>Has integrated searching functionality.</li>
</ul>
<p>For more visit <a style="text-decoration: line-through;" rel="external nofollow" href="http://www.doctrine-project.org/documentation">http://www.doctrine-project.org/documentation</a></p>
<p><strong>Example:</strong><br />
This example illustrates the way of extracting data from the database table.</p>
<p><em>File structure:<br />
</em><code>Models/<br />
Users.php – user model<br />
Doctrine/ - Doctrine library files<br />
Doctrine.php – Doctrine main file<br />
index.php</code><br />
<em>Example of index.php</em><br />
[source='php']<br />
<?php<br />
// include Dotrine main file.<br />
require_once 'Doctrine.php';</p>
<p>// register Doctrine library file loader.<br />
spl_autoload_register(array('Doctrine','autoload'));</p>
<p>// connect to database<br />
Doctrine_Manager::connection('mysql://user:password@localhost/database');</p>
<p>// set path to models<br />
Doctrine::loadModels('models');</p>
<p>// create simple query on DQL.<br />
$users = Doctrine_Query::create()->from(&#8216;Users&#8217;);</p>
<p>// print result<br />
foreach ($users as $user)<br />
echo $user->email;<br />
?><br />
[/source]</p>
<p><em>Example of Users.php</em><br />
[source='php']<br />
<?php<br />
/**<br />
* User model definition.<br />
*/<br />
class Users extends Doctrine_Record<br />
{<br />
/**<br />
* Define model metadata.<br />
*/<br />
public function setTableDefinition()<br />
{<br />
$this->setTableName(&#8216;users&#8217;);</p>
<p>$this->hasColumn(<br />
&#8216;id&#8217;,<br />
&#8216;integer&#8217;,<br />
4,<br />
array(<br />
&#8216;type&#8217; => &#8216;integer&#8217;,<br />
&#8216;length&#8217; => 11,<br />
&#8216;primary&#8217; => true,<br />
&#8216;autoincrement&#8217; => true<br />
));</p>
<p>$this->hasColumn(<br />
&#8216;email&#8217;,<br />
&#8217;string&#8217;,<br />
255,<br />
array(<br />
&#8216;type&#8217; => &#8217;string&#8217;,<br />
&#8216;length&#8217; => 255,<br />
&#8216;default&#8217; => &#8221;,<br />
&#8216;notnull&#8217; => true<br />
));<br />
}<br />
}<br />
?><br />
[/source]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.oxagile.com/2008/07/06/doctrine-in-a-php-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

