Home arrow PHP arrow Method Chaining: Adding More Selecting Methods to the CodeIgniter Library

Method Chaining: Adding More Selecting Methods to the CodeIgniter Library

In this ninth part of an 11-part series on method chaining, I will add three new chainable methods to the custom CodeIgniter model class we built in previous parts. You should find this a straightforward process, especially if you have a decent background in this frameworkís database class.

  1. Method Chaining: Adding More Selecting Methods to the CodeIgniter Library
  2. Review: the AbstractModel class's source code
  3. Building the SELECT MIN, SELECT AVG and SELECT SUM parts of a SQL statement with chainable methods
  4. The AbstractModel class's updated source code
By: Alejandro Gervasio
Rating: starstarstarstarstar / 1
November 18, 2009

print this article



While itís not going to change forever the way that PHP developers build their web applications, method chaining is a solid programming approach that permits them to build classes that have highly compact and modular interfaces.

So, if youíre always looking for new ways to improve your existing development skills and want to learn how to incorporate chainable methods into your PHP programs, then you should read this series of articles. In it youíll find a guide that will show you how to accomplish this in a truly friendly fashion.

However, if youíve been a patient reader and have already read the previous installments, then you now have a solid background in creating chainable methods with PHP 5. In those tutorials I not only explained how to implement this kind of method, but how to use them for developing a custom model library for CodeIgniter.

Now, speaking more specifically, in the preceding article I added a couple of chainable methods to the aforementioned CodeIgniter model for building the SELECT and SELECT MAX parts of a SQL query. They expanded the modelís current functionality.

Nonetheless, itís fair to say that there is still plenty of room for expanding the capabilities of the model. Therefore, in the course of this ninth part of the series Iím going to code a couple of additional chainable methods to it that will be tasked with building the SELECT MIN, SELECT SUM and SELECT AVG parts of a SELECT SQL statement respectively.

So, want to see how these brand new methods will be coded? Then, get rid of the preliminaries and start reading right now!

>>> More PHP Articles          >>> More By Alejandro Gervasio

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: