<?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>Tue, 18 Jun 2013 01:09:02 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Rob Allen: Objects in the model layer: Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/19398</guid>
      <link>http://www.phpdeveloper.org/news/19398</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> <a href="http://akrabat.com/development/objects-in-the-model-layer/">previously posted</a> about some of his practices around the different types of objects in the model layer of his Zend Framework 2 applications. In <a href="http://akrabat.com/php/objects-in-the-model-layer-part-2/">this latest post</a> he follows up and shares some example code for the different types.
</p>
<blockquote>
I previously talked about the terms I use for <a href="http://akrabat.com/development/objects-in-the-model-layer/">objects in the model layer</a> and now it's time to put some code on those bones. Note that,as always, all code here is example code and not production-ready.
</blockquote>
<p>
He includes sample classes related to his "books" examples - a "book" entity (with title, author, id and ISBN), a mapper object to load/save/delete the entity and a service object that provides an interface for the entity to the rest of the application.
</p>]]></description>
      <pubDate>Tue, 02 Apr 2013 11:55:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen: Objects in the model layer]]></title>
      <guid>http://www.phpdeveloper.org/news/19350</guid>
      <link>http://www.phpdeveloper.org/news/19350</link>
      <description><![CDATA[<p>
In <a href="http://akrabat.com/development/objects-in-the-model-layer/">this latest post</a> to his site <i>Rob Allen</i> talks some about application structure and the different kinds of objects he uses in his applications.
</p>
<blockquote>
I currently use a very simple set of core objects within my model layer: entities, mappers and service objects. [...] I dislike the phrase "service object" as the word "service" means so many things to so many people. I haven't heard a better phrase yet that everyone understands though.
</blockquote>
<p>
He defines each of the types of objects to help make the separation clearer. Here they are in brief:
</p>
<ul>
<li>Entities are objects that represent something in my business logic.
<li>Mappers know how to save and load an entity from the data store.
<li>Service objects provide the API that the rest of the application uses.
</ul>
<p>
Some of the comments on the post relate his choices to use in Zend Framework v2-based applications, noting that there are some base components you can extend to create these kinds of objects.
</p>]]></description>
      <pubDate>Fri, 22 Mar 2013 10:45:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Nitschinger: Caching Doctrine Entities with Couchbase]]></title>
      <guid>http://www.phpdeveloper.org/news/19006</guid>
      <link>http://www.phpdeveloper.org/news/19006</link>
      <description><![CDATA[<p>
<i>Michael Nitschinger</i> has a new post to his site today showing how you can <a href="http://nitschinger.at/Caching-Doctrine-Entities-with-Couchbase">cache the entities</a> you've created with Doctrine using <a href="http://www.couchbase.com">Couchbase</a> as a simple caching tool.
</p>
<blockquote>
As part of our ongoing efforts to make Couchbase more integrated with frameworks and libraries, we added caching support for the <a href="http://www.doctrine-project.org/">Doctrine ORM</a>. [...] Caching can either be used standalone (through the API provided by <a href="http://www.doctrine-project.org/projects/common.html">doctrine/common</a>) or integrated with the ORM functionality. We'll look at both variants through simple examples, a good documentation can also be found here. Note that at the time of writing, the CouchbaseCache is not mentioned as a caching driver because the documentation still needs to be updated.
</blockquote>
<p>
He walks you through the steps to get everything you need installed, both through Composer and the <a href="http://www.couchbase.com/develop/php/current">Couchbase extension</a> so your PHP installation will support it. He includes sample code that sets up the cache and shows how to check it to see if a key exists. With this base in place, he expands it out to working with the Doctrine ORM. He shows how to create a sample "Person" entity, inject it into the entity manager and perform a query with the Result Cache to locate the object.
</p>]]></description>
      <pubDate>Tue, 08 Jan 2013 10:19:07 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Bradley Holt: Entity Relationships in a Document Database at ZendCon 2012 (Video & Slides)]]></title>
      <guid>http://www.phpdeveloper.org/news/18766</guid>
      <link>http://www.phpdeveloper.org/news/18766</link>
      <description><![CDATA[<p>
If you weren't able to attend this year's <a href="http://zendcon.com">ZendCon</a> conference and wanted to see <i>Bradley Holt</i>'s talk about entity relationships and document databases, you're in luck - he's posted both <a href="http://bradley-holt.com/2012/11/entity-relationships-in-a-document-database-at-zendcon-2012/">the video and slides</a> to his site. Here's his summary of the session:
</p>
<blockquote>
Unlike relational databases, document databases like CouchDB and MongoDB do not directly support entity relationships. This talk will explore patterns of modeling one-to-many and many-to-many entity relationships in a document database. These patterns include using an embedded JSON array, relating documents using identifiers, using a list of keys, and using relationship documents. This talk will explore how these entity relationship patterns equate to how entities are joined in a relational database. We'll take a look at the relevant differences between document databases and relational databases. For example, document databases do not have tables, each document can have its own schema, there is no built-in concept of relationships between documents, views/indexes are queried directly instead of being used to optimize more generalized queries, a column within a result set can contain a mix of logical data types, and there is typically no support for transactions across document boundaries.
</blockquote>
<p>
He also includes links to two of the tools he mentions in the talk - <a href="http://docs.doctrine-project.org/projects/doctrine-couchdb/">Doctrine CouchDB</a> and the <a href="http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/">Doctrine MongoDB ORM</a>.
</p>]]></description>
      <pubDate>Mon, 19 Nov 2012 10:03:55 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Evan Coury's Blog: Using ZendDb's TableGateway & HydratingResultSet to return rows as custom enties]]></title>
      <guid>http://www.phpdeveloper.org/news/18161</guid>
      <link>http://www.phpdeveloper.org/news/18161</link>
      <description><![CDATA[<p>
<i>Evan Coury</i> has a new post to his blog about <a href="http://blog.evan.pro/zf2-tablegateway-hydration">using ZendDb's TableGateway</a> (from the Zend Framework 2) along with the HydratingResultSet feature to let you build objects from your database results.
</p>
<blockquote>
The new ZendDb in Zend Framework 2 has a handy feature which allows you to specify your own entity/model class to represent rows in your database tables. This means you can tell ZendDb to return each row as a populated instance of your own custom objects. Keep in mind that this is simply a convenience feature, and not meant to serve as a fully-featured ORM. If you're looking for a full-blown ORM, have a look at <a href="http://www.doctrine-project.org/">Doctrine 2</a>.
</blockquote>
<p>
He includes some example SQL to create a "book" table and the ZF2 code to create the Book model, set up the database connection and generate the hydrated data set from the results. An example of doing an insert into the table and then pull it back out from the TableGateway object.
</p>]]></description>
      <pubDate>Mon, 02 Jul 2012 09:32:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Service Layers in PHP Applications (a Series)]]></title>
      <guid>http://www.phpdeveloper.org/news/17004</guid>
      <link>http://www.phpdeveloper.org/news/17004</link>
      <description><![CDATA[<p>
DevShed has posted a series of tutorials talking about different sorts of service layers in PHP applications - seven of them to be exact:
</p>
<blockquote>
If you're looking for an approachable guide that teaches you how to implement an easily-customizable service layer in PHP, then take a peek at this article series. In a step-by-step fashion, it walks you through the development of a sample web application, which uses a service to perform CRUD operations on a domain model composed of a few user entities.
</blockquote>
<p>Service layer types covered in the series are:</p>
<ul>
<li><a href="http://www.devshed.com/c/a/PHP/PHP-Service-Layers-A-Final-Example/">Working with database entities</a>
<li><a href="http://www.devshed.com/c/a/PHP/PHP-Services-Layers-Data-Mappers/">Data Mappers</a>
<li><a href="http://www.devshed.com/c/a/PHP/PHP-Service-Layers-Database-Adapters/">Database adapters</a>
<li><a href="http://www.devshed.com/c/a/PHP/PHP-Service-Layers-Handling-Entity-Collections/">Handling Entity Collections</a>
<li><a href="http://www.devshed.com/c/a/PHP/PHP-Service-Layers-User-Services/">User Services</a>
<li><a href="http://www.devshed.com/c/a/PHP/PHP-Service-Layers-Dependency-Injection/">Dependency Injections</a>
<li><a href="http://www.devshed.com/c/a/PHP/PHP-Service-Layers-Modeling-Domain-Objects/">Modeling Domain Objects</a>
</ul>]]></description>
      <pubDate>Tue, 18 Oct 2011 08:50:09 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jonathan Wage's Blog: Blending the Doctrine ORM and MongoDB ODM]]></title>
      <guid>http://www.phpdeveloper.org/news/15026</guid>
      <link>http://www.phpdeveloper.org/news/15026</link>
      <description><![CDATA[<p>
On his blog today <i>Jonathan Wage</i> has <a href="http://www.jwage.com/2010/08/25/blending-the-doctrine-orm-and-mongodb-odm/">posted a tip</a> on getting MongoDB connections and queries to work through the Doctrine ORM layer:
</p>
<blockquote>
Since the start of the <a href="http://www.doctrine-project.org/projects/mongodb_odm">Doctrine MongoDB Object Document Mapper</a> project people have asked how it can be integrated with the <a href="http://www.doctrine-project.org/projects/orm">ORM</a>. This blog post demonstrates how you can integrate the two transparently, maintaining a clean domain model. This example will have a Product that is stored in MongoDB and the Order stored in a MySQL database.
</blockquote>
<p>
His code shows how to define the document and entity for the connection (a Product and Order) and creating an event subscriber to lazy load the product. He creates a sample Product and an Order for it and save them to the database. He also includes code to pull an order back out by its ID number and get an Order object back out (with Product data inside).
</p>]]></description>
      <pubDate>Thu, 26 Aug 2010 13:34:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Giorgio Sironi's Blog: When to inject: the distinction between newables and injectables]]></title>
      <guid>http://www.phpdeveloper.org/news/12974</guid>
      <link>http://www.phpdeveloper.org/news/12974</link>
      <description><![CDATA[<p>
Following up on a <a href="http://www.phpdeveloper.org/news/12960">previous post</a> about dependency injection, <i>Giorgio Sironi</i> has posted <a href="http://giorgiosironi.blogspot.com/2009/07/when-to-inject-distinction-between.html">this new look</a> at when to use dependency injection and when its still better to handle objects individually.
</p>
<blockquote>
In the last post, I introduced Dependency Injection and show useful cases where it allows classes decouplng. I also wrote about the problem of how to inject a service in a class that has to be instantiated not application wide but in the business logic.
</blockquote>
<p>
He creates an example that shows a not-so-good place to use dependency injection and offers a solution - a factory that creates the objects as they're needed instead of having them floating around when they're not needed. He also talks about the difference between two types of business objects to consider in dependency injection: entities and services (hint: one depends on the other).
</p>]]></description>
      <pubDate>Fri, 31 Jul 2009 10:58:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ProDevTips.com: HTML entity encoding everything]]></title>
      <guid>http://www.phpdeveloper.org/news/9529</guid>
      <link>http://www.phpdeveloper.org/news/9529</link>
      <description><![CDATA[<p>
On the ProDevTips site, <i>Henrik</i> has pointed out <a href="http://www.greywyvern.com/php">a handy application</a> that can make HTML encoding characters outside the norm in PHP simple.
</p>
<blockquote>
The standard htmlentities() function will encode special characters so that they display OK in the browser. However, sometimes you might want to encode different languages to entities too. I just found a script that will do that in the form of an <a href="http://www.greywyvern.com/php">html encode application</a>.
</blockquote>
<p>
He <a href="http://www.prodevtips.com/2008/01/30/html-entity-encoding-everything/">includes an example</a> showing how to encode a string of non-english characters out to an easy-to-display HTMLified string.
</p>]]></description>
      <pubDate>Wed, 30 Jan 2008 12:57:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[International PHP Magazine: Poll Question: What is the Top Mistake That PHP Coders Commit?]]></title>
      <guid>http://www.phpdeveloper.org/news/7238</guid>
      <link>http://www.phpdeveloper.org/news/7238</link>
      <description><![CDATA[<p>
The International PHP Magazine has <a href="http://www.php-mag.net/magphpde/magphpde_news/psecom,id,26857,nodeid,5.html">posted results</a> from their latest PHP community poll as voted on by visitors to their site. The question for this poll asked developers what they thought, of the choices on the list, was the most common mistake that PHP developers make.
</p>
<p>
Coming in at number one by an overwhelming lead was "Not escaping entities and SQL input" (a definite problem indeed) with the next highest option, "Not using a Framework" a full twenty percent lower. The next two options were closer (descending) - "Using old PHP versions" and "No or little use of Object Orientation".
</p>
<p>
There's a <a href="http://www.php-mag.net/magphpde/magphpde_news/psecom,id,26858,nodeid,5.html">new poll</a> this week for your consideration - this time asking which stage, of the five options, should come first in the development cycle of a typical content management system. Head on over and cast your vote today!
</p>]]></description>
      <pubDate>Wed, 07 Feb 2007 10:43:00 -0600</pubDate>
    </item>
  </channel>
</rss>
