<?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 19:07:06 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Refulz Blog: Yii Framework - Scenarios for Conditional Multiple Validation Rules]]></title>
      <guid>http://www.phpdeveloper.org/news/17857</guid>
      <link>http://www.phpdeveloper.org/news/17857</link>
      <description><![CDATA[<p>
On the Refulz blog there's a post showing you how to <a href="http://php.refulz.com/yii-framework-scenarios-for-conditional-multiple-validation-rules/">set up conditional multiple validation rules</a> in a Yii framework application.
</p>
<blockquote>
I am yet to write the last article of the <a href="http://php.refulz.com/series/sessions-in-yii/">Yii Session</a> series. I just decided to write something about the scenarios in the Validation feature of Yii framework. Scenarios are a very useful tool for adding different validations rules for different cases on the same model. In a real life situation, you would require one validation rule for user registration but the same rule might not be applicable to the User login. Scenarios help you define validation rules for different situations within same model.
</blockquote>
<p>
He shows you how to set up a "rules()" method in your model and a few validation configurations inside it - ensuring the password and email are set, checking the length of the password, etc. Then, by calling the "validate()" method on the model, you can easily apply these rules and check the pass/fail status.
</p>]]></description>
      <pubDate>Tue, 24 Apr 2012 09:18:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: An Introduction to Services]]></title>
      <guid>http://www.phpdeveloper.org/news/17771</guid>
      <link>http://www.phpdeveloper.org/news/17771</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new article from <i>Alejandro Gervasio</i> introducing you to <a href="http://phpmaster.com/an-introduction-to-services/">the concept of "services"</a>, a layer put on top of your models to make a common API that's easier to reuse.
</p>
<blockquote>
Don't let the definition freak you out, as if you've been using MVC for a while the chances are you've used a service already. Controllers are often called services, as they carry out application logic and additionally are capable of interfacing to several client layers, namely views. Of course in a more demanding environment, plain controllers fail short in handling several clients without the aforementioned duplicating, so that's why the construction of a standalone layer is more suitable in such cases.
</blockquote>
<p>
He explains the process behind creating a simple domain model (<a href="http://cdn.phpmaster.com/files/2012/02/service_diagram.png">image here</a>)  and shows how the Service layer wraps it up into a simpler interface, leaving the model to handle the business logic. He uses the example of an "EncoderInterface" that's implemented in a "JsonEncoder" and "Serializer" to both provide a "setData" method. 
</p>]]></description>
      <pubDate>Tue, 03 Apr 2012 13:12:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Access view variables in another view model]]></title>
      <guid>http://www.phpdeveloper.org/news/17770</guid>
      <link>http://www.phpdeveloper.org/news/17770</link>
      <description><![CDATA[<p>
In <a href="http://akrabat.com/zend-framework-2/access-view-variables-in-another-view-model/">this new post</a> to his blog <i>Rob Allen</i> shows you how to access the view variables from another ViewModel.
</p>
<blockquote>
Unlike Zend Framework 1, the view layer in Zend Framework 2 separates the variables assigned to each view model. This means that when you are in the layout view script, you don't automatically have access to variables that were assigned the the action's view model and vice versa.
</blockquote>
<p>
He includes snippets of code with an example controller and a sample view that fetches a value from a child ViewModel instance. He also shows how to access layout and configuration values in the view.
</p>]]></description>
      <pubDate>Tue, 03 Apr 2012 12:53: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[Michael Nitschinger's Blog: Introducing Relationships in Lithium]]></title>
      <guid>http://www.phpdeveloper.org/news/17625</guid>
      <link>http://www.phpdeveloper.org/news/17625</link>
      <description><![CDATA[<p>
In <a href="http://nitschinger.at/Introducing-Relationships-in-Lithium">this new post</a> to his blog <i>Michael Nitschinger</i> introduces relationships in using the Lithium framework - functionality to link your models to each other to create dependencies.
</p>
<blockquote>
The model relationship support in Lithium is one of the hottest topics on IRC lately, so I thought it would be a good idea to blog about it. Currently, Lithium supports 1:1 and 1:n relationships for relational databases. [...] This post gives you a little background on relationship types and their database representations before we implement a simple example in PHP.
</blockquote>
<p>
He gives some code (and schema) examples of creating these relationships between tables for the two types - one to one and one to many. He also touches on the zero-to-zero relationships as well, nothing that they can be some of the most tricky to work with. He includes the SQL and the code you'll need to produce a blog example with models for Authors, Posts and Groups. Using the belongsTo/hasMany/hasOne variables he defines the relationships and uses the "with" keyword in the find calls to pull in those relations.
</p>]]></description>
      <pubDate>Mon, 05 Mar 2012 11:21:39 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Building a Domain Model - An Introduction to Persistence Agnosticism]]></title>
      <guid>http://www.phpdeveloper.org/news/17591</guid>
      <link>http://www.phpdeveloper.org/news/17591</link>
      <description><![CDATA[<p>
On PHPMaster.com there's <a href="http://phpmaster.com/building-a-domain-model/">a recent tutorial</a> introducing the concept of a "domain model" and showing how to create them in PHP (manually, not inside of any ORM or database solution).
</p>
<blockquote>
First off, creating a rich Domain Model, where multiple domain objects with well-defined constraints and rules interact, can be a daunting task. Second, not only is it necessary to define from top to bottom the model itself, but it's also necessary to implement from scratch or reuse a mapping layer in order to move data back and forward between the persistence layer and the model in question. 
</blockquote>
<p>
They include an example of a set of domain models tat relate to one another - a blog setup with posts, comments and users. They show how to create the AbstractEntity to handle a bit of the magic behind the scenes, an example "Post" and "Comment" models and how they can be put to work creating some posts and appending comments. A little bit of markup is included to output the results.
</p>]]></description>
      <pubDate>Mon, 27 Feb 2012 12:58:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Nitschinger's Blog: RFC: li3_fixtures Rewrite]]></title>
      <guid>http://www.phpdeveloper.org/news/17588</guid>
      <link>http://www.phpdeveloper.org/news/17588</link>
      <description><![CDATA[<p>
<i>Michael Nitchinger</i> has a new post to his blog about <a href="http://nitschinger.at/RFC-li3_fixtures-Rewrite">a rewrite for the Lithium framework</a> - changing up the li3_fixtures plugin to make it a bit more of what the community needs.
</p>
<blockquote>
The <a href="https://github.com/daschl/li3_fixtures">li3_fixtures</a> plugin was my first Lithium plugin ever, and while it works okay, I feel there is a lot I can do to make it better and more flexible. In this post I want to share my ideas for a new fixture plugin and also want to gather feedback from the community to make it even more awesome.
</blockquote>
<p>
He gives three instance where fixtures can come in extremely useful - making effective model unit tests with predictable data, mocking models with shortcuts to the data and mocking out web services. Want to add in your own suggestions for his refactor? <a href="http://nitschinger.at/RFC-li3_fixtures-Rewrite">Comment on the post!</a>
</p>]]></description>
      <pubDate>Mon, 27 Feb 2012 09:23:37 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Refulz.com: CakePHP evolves to 2.0]]></title>
      <guid>http://www.phpdeveloper.org/news/17517</guid>
      <link>http://www.phpdeveloper.org/news/17517</link>
      <description><![CDATA[<p>
On the Refulz.com blog there's a new post looking at <a href="http://php.refulz.com/cakephp-evolves-to-2/">some of the new features in CakePHP 2.0</a> including its use of lazy loading, the CakeEmail library and the new class loader.
</p>
<blockquote>
With CakePHP 2.0, they have dropped support for PHP 4 and have refactored the library code to make it strictly complaint with PHP 5.2+. Modeled on Ruby on Rails (RoR), CakePHP is a tough competition to Zend framework, Symfony and CodeIgniter.
</blockquote>
<p>
Besides the topics mentioned above, he also goes into the details of the new CakeRequest and CakeResponse models (to access information about teh current request/response). Summaries of all of the new functionality are provided along with some sample code where needed to illustrate.
</p>]]></description>
      <pubDate>Wed, 08 Feb 2012 11:15:43 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Zend Framework from Scratch - Models and Integrating Doctrine ORM]]></title>
      <guid>http://www.phpdeveloper.org/news/17390</guid>
      <link>http://www.phpdeveloper.org/news/17390</link>
      <description><![CDATA[<p>
NetTuts.com has posted a second tutorial in their series focusing on the Zend Framework today. In <a href="http://net.tutsplus.com/tutorials/php/zend-framework-from-scratch-models-and-integrating-doctrine-orm/">this latest article</a> they focus on integrating the powerful <a href="http://doctrine-project.org">Doctrine</a> ORM with a Zend Framework application.
</p>
<blockquote>
Ready to take your PHP skills to the next level? In this new "From Scratch" series, we'll focus exclusively on <a href="http://framework.zend.com/">Zend Framework</a>, a full-stack PHP framework created by Zend Technologies. This second tutorial on our series is entitled "Models and Integrating Doctrine ORM".
</blockquote>
<p>
They continue on from their <a href="http://net.tutsplus.com/tutorials/php/zend-framework-from-scratch/">previous tutorial</a> to talk about what models are (with an example involving "bankers"). They also show how to use the Zend Framework "zf" command line tool to configure your database settings, set up the tables and download/bootstrap the Doctrine code. The include the code to create some simple models and how to use them to create and update records in your database. You can grab all of the sample code for their examples from <a href="https://github.com/nikkobautista/The-Next-Social">The Next Social's github repository</a>.
</p>]]></description>
      <pubDate>Fri, 13 Jan 2012 10:58:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Building an ORM in PHP: Domain Modeling]]></title>
      <guid>http://www.phpdeveloper.org/news/17159</guid>
      <link>http://www.phpdeveloper.org/news/17159</link>
      <description><![CDATA[<p>
Continuing on from the <a href="http://phpdeveloper.org/news/17146">first part</a> of their series, DevShed has posted part two of their "Building an ORM in PHP" series. This latest tutorial <a href="http://www.devshed.com/c/a/MySQL/Building-an-ORM-in-PHP-Domain-Modeling/">focuses on domain modeling</a> (and collection handling).
</p>
<blockquote>
In that first part, I implemented the ORM's data access and mapping layers. And as you'll surely recall, the entire implementation process was pretty straightforward and easy to follow. Of course, in its current state the ORM is still far from a fully-functional structure. We need to add some additional components to it, such as a domain model and the classes responsible for handling collections of entities (remember that the ORM relies heavily on the data mapper pattern to do its business properly).
</blockquote>
<p>
He stays with his "simple blog" example and shows domain models (based on an abstract entity) for Entries, Comments and Authors. His containers extend the Countable, IteratorAggregate and ArrayAccess interfaces to give them some extra abilities.
</p>]]></description>
      <pubDate>Tue, 22 Nov 2011 16:46:10 -0600</pubDate>
    </item>
  </channel>
</rss>

