final class Inflector (View source)

Path class can help to get the various paths like root folder, stub folder, model folder and so on.

Methods

static string
classify(string $string)

Get Class name as Laravel style.

static string
pluralize(string $string)

Get Class name as hasMany method name.

static string
tableize(string $string)

Get Class name as belongsTo method name.

static string
title(string $string)

get title from Doctrine table

Details

static string classify(string $string)

Get Class name as Laravel style.

Returns a word in singular form.

Parameters

string $string

raw table name

Return Value

string

The method returns Model class name as Laravel style

static string pluralize(string $string)

Get Class name as hasMany method name.

Returns a word in plural form.

Parameters

string $string

raw Class name

Return Value

string

The method returns hasMany method name

static string tableize(string $string)

Get Class name as belongsTo method name.

Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'.

Parameters

string $string

raw Class name

Return Value

string

The method returns belongsTo method name

static string title(string $string)

get title from Doctrine table

Parameters

string $string

raw Class name

Return Value

string

The method returns title