ActiveRecord in PHP, in < 1,000 LOC