Model::_class_name_to_table_name PHP Method

_class_name_to_table_name() protected static method

Then convert a class name in CapWords to a table name in lowercase_with_underscores. Finally strip doubled up underscores For example, CarTyre would be converted to car_tyre. And Project\Models\CarTyre would be project_models_car_tyre.
protected static _class_name_to_table_name ( string $class_name ) : string
$class_name string
return string
    protected static function _class_name_to_table_name($class_name)
    {
        return strtolower(preg_replace(array('/\\\\/', '/(?<=[a-z])([A-Z])/', '/__/'), array('_', '_$1', '_'), ltrim($class_name, '\\')));
    }