DevShed has the latest article in their tutorial series looking at the Active Record design pattern posted today. This time they focus on a bit of refactoring to make their MySQL abstraction class a bit easier to use and work better.
As I stated in the end of the [previous] tutorial, however, some methods of this sample class implement redundant business logic, and as a consequence itâ€™s necessary to refactor them to fix this issue in a quick and simple manner. Thus, in the next few lines Iâ€™ll be explaining how to accomplish this process progressively, and as always, accompanied by the corresponding code samples.
They change up some of the CRUD (Create, Read, Update, Delete) functions by dynamically constructing the SQL and updating the fetch functions to allow for more modifiers like "LIKE" or "LIMIT".