ActiveRecord implementation for PHP