Implementation and Sample Code for usage of the Factory Pattern with PHP