design pattern example - php