Conversion Examples
Find Table Name For This Class
class OrderDetail extends ActiveRecord {
function __construct() {
$table_name = Inflector::tableize(get_class());
// $table_name is now "order_details"
}
}
Find Class Name For A Table
$class_name = Inflector::classify("people");
// $class_name is now "Person"
Generate User Friendly Description Of A Table
$readable_name = Inflector::humanize("monthly_reports");
// $readable_name is now "Monthly Reports"
Find Foreign Key For A Class
$key_name = Inflector::foreign_key("PartNumber");
// $key_name is now "part_number_id"