beggining design pattern by PHP