<?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 16:27:42 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Andrew Podner: Overloading: Create PHP Class Methods on the Fly]]></title>
      <guid>http://www.phpdeveloper.org/news/19279</guid>
      <link>http://www.phpdeveloper.org/news/19279</link>
      <description><![CDATA[<p>
<i>Andrew Podner</i> has a new post today looking at <a href="http://unassumingphp.com/overloading-create-methods-on-the-fly/">dynamic class method creation</a> in PHP - aka "overloading" with the __call magic method.
</p>
<blockquote>
What is overloading and what would I need it for? [...] In most languages, overloading just means you can have multiple methods with the same name, but they just had a different number/type of arguments.  In PHP, it is a little different.  Overloading in PHP means that you can actually create dynamic function names and the behavior will be dependent upon the function name that is used.
</blockquote>
<p>
He gives an example through a sample application, first stating the requirements the business has for it then showing how to use the "__call" method to handle "getBy" requests made to a database class. It searches the database based on the field (ex. "getByusername" searches on "username") and he includes two examples of it in use. He also briefly touches on the use of the "__callStatic" magic method for handling static method calls similarly.
</p>]]></description>
      <pubDate>Wed, 06 Mar 2013 11:51:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Timothy Boronczyk's Blog: Evil Access (a Database Class)]]></title>
      <guid>http://www.phpdeveloper.org/news/11787</guid>
      <link>http://www.phpdeveloper.org/news/11787</link>
      <description><![CDATA[<p>
<i>Timothy Boronczyk</i> has <a href="http://zaemis.blogspot.com/2009/01/database-access.html">posted a class</a> that provides a different sort of theory on database access:
</p>
<blockquote>
I was thinking today about database APIs when inspiration struck. I ended up hacking out the following class, which I think demonstrates a rather interesting approach to interfacing with a database (interesting enough at least to post here).
</blockquote>
<p>
His class implements an Iterator and lets you bend a few of the rules PHP normally has in place (use of the magic methods, special characters in an identifier). He also includes an example of its use - connecting to the database, selecting information and pulling that information back out.
</p>]]></description>
      <pubDate>Wed, 21 Jan 2009 21:34:04 -0600</pubDate>
    </item>
  </channel>
</rss>
