<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 23 May 2012 18:17:38 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Handling Collections of Aggregate Roots - the Repository Pattern]]></title>
      <guid>http://www.phpdeveloper.org/news/17969</guid>
      <link>http://www.phpdeveloper.org/news/17969</link>
      <description><![CDATA[<p>
On PHPMaster.com today they have a new tutorial focusing on <a href="http://phpmaster.com/handling-collections-of-aggregate-roots/">using the Repository</a> (a part of the <a href="http://en.wikipedia.org/wiki/Domain-driven_design">domain driven design</a> architecture) to enhance your model's current functionality.
</p>
<blockquote>
Unlike mappers, though, which are part of the infrastructure, a repository characterizes itself as speaking the model's language, as it's intimately bound to it. And because of its implicit dependency on the mappers, it preserves the persistence ignorance as well, therefore providing a higher level of data abstraction, much closer to the domain objects.
</blockquote>
<p>
Included in the tutorial is the full code you'll need to create a simple UserInterface class and a User model that extends it. He also makes a UserCollection class to handle working with multiple User objects and a UserMapper to handle the actual data source fetching. Finally, he implements the Repository on top of this base structure showing how it lays on top of everything via the UserMapperInterface instance. At the end some example code showing it in use is also included - making the PDO connection, creating the UserRepository and fetching by a few different data types (email, name and role).
</p>]]></description>
      <pubDate>Thu, 17 May 2012 08:44:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Building a Domain Model - Integrating Data Mappers]]></title>
      <guid>http://www.phpdeveloper.org/news/17691</guid>
      <link>http://www.phpdeveloper.org/news/17691</link>
      <description><![CDATA[<p>
In <a href="http://phpdeveloper.org/news/17591">this previous post</a> PHPMaster.com introduced you to the concept of "domain models", structures defining how data should be formatted for consistency. In <a href="http://phpmaster.com/integrating-the-data-mappers/">this second part</a> of the series, <i>Alejandro</i> show show to integrate them with a data access layer (DAL) to make them easier to work with.
</p>
<blockquote>
The phrase may sound like an cheap clich&eacute;, I know, but I'm not particularly interested in reinventing the wheel each time I tackle a software problem (unless I need a nicer and faster wheel, of course). In this case, the situation does warrant some additional effort considering we'll be trying to connect a batch of mapping classes to a blog's domain model. Given the magnitude of the endeavor, the idea is to set up from scratch a basic Data Access Layer (DAL) so that domain objects can easily be persisted in a MySQL database, and in turn, retrieved on request through some generic finders.
</blockquote>
<p>
He includes all the code you'll need to create a (namespaced) database adapter (PDO), the mapping layer to tie the domain models together and using it all in a practical "blog" example with posts, comments and users.
</p>]]></description>
      <pubDate>Mon, 19 Mar 2012 11:27:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Building an ORM in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17146</guid>
      <link>http://www.phpdeveloper.org/news/17146</link>
      <description><![CDATA[<p>
On DevShed today there's a new tutorial showing you how to <a href="http://www.devshed.com/c/a/MySQL/Building-an-ORM-in-PHP/">build a basic ORM layer</a> on top of a MySQL database. It includes all the code you'll need (cut&paste-able, not as a download).
</p>
<blockquote>
Obviously, with so many ORMs at one's disposal for free, it seems pretty pointless to develop a custom one; are we trying to reinvent the wheel? No, of course not. But if you need to create a simple application that performs a few CRUD operations on some related domain objects and don't want to climb the learning curve of a third-party library, then implementing a custom ORM might make sense. There's alos the educational aspect of the process (yes, learning one or two things never hurts).
</blockquote>
<p>
They start you off with the creation of the "data persistence layer" (an interface first) to connect to the database, building a MySQL-specific one on top of it. Next up is the data mapper layer making things like "fetch by ID" and the insert/update/delete possible. Their simple example doesn't include anything about ORM relationships, though - just fetching simple rows.
</p>]]></description>
      <pubDate>Fri, 18 Nov 2011 09:45:15 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[ServerGrove.com: MongoDB with PHP and symfony]]></title>
      <guid>http://www.phpdeveloper.org/news/14444</guid>
      <link>http://www.phpdeveloper.org/news/14444</link>
      <description><![CDATA[<p>
In a recent post to the ServerGrove.com blog today there's a look at <a href="http://blog.servergrove.com/2010/04/28/mongodb-with-php-and-symfony/">using the MongoDB with symfony</a> to create a simple application with a NoSQL-based backend.
</p>
<blockquote>
Part of our business is to develop internal applications and  support customers, so we dedicate a good amount of time to research, test and learn new technologies. We have been following this whole movement and decided to give MongoDB a try. What has really taken our attention regarding MongoDB is its simplicity, yet how powerful it is. It lowers the barrier to develop DB-driven applications even more.
</blockquote>
<p>
They start by explaining how to use MongoDB together with PHP and get both the server and client sides up and running. From there they introduce <a href="http://github.com/jwage/odm">ODM</a>, a object document mapper from <i>Jon Wage</i> (of the <a href="http://doctrine-project.org">Doctrine</a> project) that lets you easily interact with MongoDB instances. A code sample it provided to show how simple the tool is to use and how it can integrate with <a href="http://symfony-project.org">symfony</a> as an entity.
</p>]]></description>
      <pubDate>Fri, 30 Apr 2010 13:10:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michelangelo van Dam's Blog: Zend Framework data models]]></title>
      <guid>http://www.phpdeveloper.org/news/13825</guid>
      <link>http://www.phpdeveloper.org/news/13825</link>
      <description><![CDATA[<p>
<i>Michelangelo van Dam</i> has <a href="http://www.dragonbe.com/2010/01/zend-framework-data-models.html">a recent post</a> to his blog about a difficulty he was having with his Zend Framework application and setting up some data models.
</p>
<blockquote>
I was struggling getting my data models (as described in the <a href="http://framework.zend.com/docs/quickstart">Zend Framework Quickstart</a>) to work with relations. My first solution was to create a database view that merged that data using joins to collect this data in a format that I could use in my data models. This was going great until I looked at my database where it contained over 20 views (along with 20 data models, mappers and db table gateways) ! So I said to myself there had to be another way.
</blockquote>
<p>
His other way came in the form of the <a href="http://framework.zend.com/manual/en/zend.db.table.relationships.html">Zend_Db_Table_Relationships</a> component and, after a bit of work, it did just what he needed. He shares how you can set them up similarly by walking you through the creation of a sample application ("datamodels") and linking together a series of sample tables with a Db_Table class using relationships, a simple model to abstract data access and a model mapper class to redefine some of the based functions (like "findAll") to pull in data from other tables.
</p>]]></description>
      <pubDate>Tue, 12 Jan 2010 12:05:05 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Doctrine Blog: Doctrine 1.0.8 and 1.1.0-RC2 Released]]></title>
      <guid>http://www.phpdeveloper.org/news/12055</guid>
      <link>http://www.phpdeveloper.org/news/12055</link>
      <description><![CDATA[<p>
<i>Guilherme Blanco</i> passed along a note about the latest releases from the Doctrine project, <a href="http://www.doctrine-project.org/blog/doctrine-1-0-8-and-1-1-0-rc2-released">Doctrine 1.0.8 and 1.1.0-RC2</a>:
</p>
<blockquote>
Today I am happy to tell you that we have two new versions of Doctrine available for you to use. The first is the monthly maintenance release for Doctrine 1.0 and the second is another release candidate for the newest major version of Doctrine, 1.1. As always you can grab them from the <a href="http://www.doctrine-project.org/download">downloads page</a>.
</blockquote>
<p>
Updates in these two versions include a few backported fixes from 1.1, updates to the Doctrine_Query::count() method for optimization, and several fixes in the Release Candidate in preparation for the next release. You can see the full Changelogs here: <a href="http://www.doctrine-project.org/change_log/1_0_8">1.0.8</a> and <a href="http://www.doctrine-project.org/change_log/1_1_0_RC2">1.1.0-RC2</a>.
</p>]]></description>
      <pubDate>Tue, 03 Mar 2009 10:24:36 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: Wide Finder in...errr...PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/8948</guid>
      <link>http://www.phpdeveloper.org/news/8948</link>
      <description><![CDATA[<p>
In a <a href="http://www.sitepoint.com/blogs/2007/11/01/wide-finder-in-errr-php/">new post</a> on the SitePoint PHP blog today, <i>Harry Fuecks</i> has created a "wide finder" based on <a href="http://www.tbray.org/ongoing/When/200x/2007/09/20/Wide-Finder">a project</a> put together by <i>Tim Bray</i>.
</p>
<blockquote>
Tim set a simple, but very much real-world challenge; write an app that determines the top 10 most popular blogs from his Apache access log. It should be fast and readable, with a subtext of illustrating how "language X" copes in terms of parallel processing and utilizing "wider" (many processor) systems.
</blockquote>
<p>
Since PHP natively doesn't support multi-threading (well), <i>Harry</i> opted to go with an approach using <a href="http://www.php.net/manual/en/function.curl-multi-exec.php">curl_multi_exec</a> instead. There's two pieces to the puzzle - the mapper to grab the information and extract the data and the reducer that makes the calls to grab the information from the log files.
</p>]]></description>
      <pubDate>Thu, 01 Nov 2007 08:24:00 -0500</pubDate>
    </item>
  </channel>
</rss>

