OO php code sample with the use of jQuery and AJAX