Implementation of Active Record pattern in PHP