| ||Date ||Title ||Author ||Hits |
| || 01-03-11 || ||Alejandro Gervasio ||9160 |
In this fourth part of the series, I will build a simple countable iterator. It will be able to easily manipulate collections of entities by using an array-like notation. What’s more, if you frequently implement different kinds of inner iterators, then you'll quickly understand the logic behind this one.
| || 12-29-10 || ||Alejandro Gervasio ||36917 |
In this third installment of the series, I develop a basic data access layer using PHP and MySQL. It is made up of a single interface and an implementer of it, which in this case is a simple MySQL abstraction class. The construction of this additional layer takes us one step closer to developing a UoW that can be used in a truly helpful fashion.
| || 12-28-10 || ||Codex-M ||15934 |
This is a tutorial targeted to beginners who need to know the best way of checking if a web form is submitted using PHP. The majority of PHP web applications are form handling tasks, and it is vital that you know the different ways of checking form submission.
| || 12-27-10 || ||Alejandro Gervasio ||13789 |
In this second tutorial of the series, I add to the previous UoW class a pair of collaborators that it needs to function properly. These are an abstract data mapper tasked with interacting with the persistence layer, and an additional abstract class responsible for modeling generic entities.
| || 12-22-10 || ||Codex-M ||95645 |
You might need to offer some of your website's content for downloading. For example, many sites commonly offer downloads of PDF and MP3 files. If you do this, you'll want to set up your download system so that it can give you certain information and perform certain tasks, like telling you how often certain files have been downloaded or limiting the number of downloads. This article will show you how to create a download script that accomplishes this and more.
| || 12-21-10 || ||Alejandro Gervasio ||12916 |
Are you trying to optimize the way your web application handles domain objects, and not finding a good solution? If caching won't help, and data and identity mappers won't suit your needs, you might want to look at using a Unit of Work pattern. What is a UoW? Keep reading to learn how it can help you.
| || 12-16-10 || ||Codex-M ||94225 |
This Google Maps tutorial will walk you through the finer points of using the Google Directions REST API and JSON with PHP to load, parse and display your Google Maps. This article covers use of the Google API both with and without a Maps API key and includes PHP code examples for parsing the Directions or Web Services APIs from Google.
| || 12-15-10 || ||Alejandro Gervasio ||11619 |
Welcome to the conclusion to an eight-part article series on constructing your own repository from scratch in PHP. In this article, we'll go through an example that shows you how the repository we completed in the previous article actually performs. You'll see all of the classes we created in action.
| || 12-13-10 || ||Alejandro Gervasio ||9215 |
In this penultimate installment of the series, I extend the functionality of the user repository created in the previous part by adding two methods to it. These methods will handle adding new user entities to the underlying MySQL database and removing existing ones. Their implementation, as you'll see, will be a fairly straightforward process.
| || 12-08-10 || ||Alejandro Gervasio ||8968 |
In this sixth part of the series, I start using all of the sample classes defined previously to create a basic user repository class. The partial construction of this class calls for some extra work, such as defining a repository factory. The development process, as you'll see, is pretty straightforward, and shows how useful this kind of abstraction layer can be for concentrating querying code behind an intuitive API.
| || 12-07-10 || ||Alejandro Gervasio ||8324 |
In this fifth part of the series, I add two additional classes to our sample PHP application. They will be responsible for handling collections of generic entities, and more specifically, collections of user objects. In truth, these new classes will be simple countable iterators, capable of accessing the entities as if they were array elements.
| || 12-01-10 || ||Alejandro Gervasio ||15886 |
In this fourth tutorial of the series, I added three methods to the data mapper class. They will be used for saving and deleting the table rows related to a specified entity. With this parent class fully implementing the methods declared by the “DataMapperInterface” interface, it will be easy to create a refined subclass that can specifically map user objects.
| || 11-29-10 || ||Alejandro Gervasio ||9580 |
In this third part of the series, I add a simple mapping layer to the sample application. This layer will be composed of a single interface and a generic mapper class.
| || 11-23-10 || ||Alejandro Gervasio ||16134 |
In this second installment of the series, I create a simple data access layer. It will be comprised of a single interface, and a basic MySQL abstraction class.
| || 11-17-10 || ||Alejandro Gervasio ||13743 |
In this introductory part of a series, I give you an overview of what a repository is and how it can be used for handling collections of domain objects in PHP. Since my goal here is to address the subject from a practical point of view, after I explain some theoretical concepts, I will develop a simple domain layer comprised of two classes. The first one will be an abstract parent that defines the structure and behavior of generic entities, while the second class will be responsible for modeling simple user objects, according to a number of predefined constraints.