basic php pattern for Search class