PHP implementation of Rails Active Record