<?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, 19 Jun 2013 02:05:10 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Felix Geisendorfer's Blog: Modeling relationships in CakePHP (faking Rails' ThroughAssociation)]]></title>
      <guid>http://www.phpdeveloper.org/news/6579</guid>
      <link>http://www.phpdeveloper.org/news/6579</link>
      <description><![CDATA[<p>
On the ThinkingPHP Blog today, <i>Felix</i> brings another feature of the popular Rails framework over to the world of PHP - in <a href="http://www.cakephp.org">CakePHP</a> specifically:
</p>
<blockquote>
The idea behind it is pretty simple: Often you have two Models that are associated with each other where setting the associations themself via hasAndBelongsToMany isn't quite enough for what you try to to.
</blockquote>
<p>
He <a href="http://www.thinkingphp.org/2006/10/26/modeling-relationships-in-cakephp-faking-rails-throughassociation/">gives an example</a> of the code, a method to get around the typical CRUD pattern without breaking it. His example involves users and groups and storing information surrounding them. Storing the data about the groups and which users belong to which groups is easy - it's when you start including some meta-data into the mix that things get a little complex.
</p>
<p>
He provides the sample code to make it all work - three models and three controllers - and the database structure to work behind the scenes.
</p>]]></description>
      <pubDate>Thu, 26 Oct 2006 07:12:52 -0500</pubDate>
    </item>
  </channel>
</rss>
