Many PHP systems will implement object types (for example, Models) that allow the client programmer to define a method in their classes like this:
class Car extends Model { public function _afterSave() {
In documentation and textbooks, this pattern is usually introduced as an observer / listener pattern.
However, although you can describe this method as listening to actions on the parent class, it looks like something other than the classic OOP observer pattern .
Is there a formal name for a template that allows client programmers to define these types of methods before / after, or is it just something early PHP developers outlined before the language developed its java / C #, for example, OOP?
source share