<?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>Thu, 20 Jun 2013 02:18:35 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Jamie Rumbelow's Blog: Named Scopes with CodeIgniter]]></title>
      <guid>http://www.phpdeveloper.org/news/13797</guid>
      <link>http://www.phpdeveloper.org/news/13797</link>
      <description><![CDATA[<p>
<i>Jamie Rumbelow</i> has <a href="http://jamieonsoftware.com/blog/entry/named-scopes-with-codeigniter">proposed an idea</a> to help simply some of the interactions your <a href="http://codeigniter.com">CodeIgniter</a> application can have with your databases by using named scopes.
</p>
<blockquote>
Named scopes are a really powerful feature of models - they allow you to define a clean, concise syntax when performing queries within your models - and best of all, are really easy to utilize in CodeIgniter. The main principle of a named scope is that you create a method that, combined with method chaining, allows you to add details to your query (generally additional WHERE clauses).
</blockquote>
<p>
He shows two "before and after" examples of multi-line requests condensed down by making a custom model layer with methods containing the commonly used portions of the database calls and returning the "$this" object so it can be used for chaining.
</p>]]></description>
      <pubDate>Thu, 07 Jan 2010 12:20:20 -0600</pubDate>
    </item>
  </channel>
</rss>
