Modern ActiveRecord implementation for PHP 5.4+