DevShed has a new tutorial posted today - Object Interaction in PHP: Introduction to Aggregation, part 1 - a look at how you can let objects use each other in PHP.
In this article, we'll introduce ourselves to the process of implementing aggregation (allowing one object to use another object) in PHP, to help us learn more about the possible ways to make object interaction work for us.
How do objects interact? Fortunately, the answer is quite straightforward, since this interaction can be defined within well-known OOP pillars. The first trusted friend is inheritance, which offers a powerful mechanism for building class hierarchies, and allows us to address specific issues in a number of subclasses without the need to recreate the logic or functionality that already exists in the super class or parent class. The next big ally of inheritance is polymorphism, which is defined as the ability of different classes to behave differently for the same operation.
Using the example of a dataMailer class, they step you through some of these concepts, explaining everything along the way. If you've just gotten into OOP in PHP, this could be considered the next step - really using the power that PHP has to offer.




