Trait ConventionsTrait
Provides methods that allow other classes access to conventions based inflections.
Method Summary
-
camelize() protected
Creates a camelized version of $name
-
entityName() protected
Creates the proper entity name (singular) for the specified name
-
fixtureName() protected
Creates a fixture name
-
modelKey() protected
Creates the proper underscored model key for associations
If the input contains a dot, assume that the right side is the real table name.
-
modelNameFromKey() protected
Creates the proper model name from a foreign key
-
pluginNamespace() protected
Return plugin's namespace
-
pluginPath() protected
Find the correct path for a plugin. Scans $pluginPaths for the plugin you want.
-
pluralHumanName() protected
Creates the plural human name used in views
-
singularHumanName() protected
Creates the singular human name used in views
-
singularName() protected
Creates the singular name for use in views.
-
variableName() protected
Creates the plural variable name for views
Method Detail
camelize() ¶ protected
camelize(string $name): string
Creates a camelized version of $name
Parameters
-
string$name name
Returns
stringCamelized name
entityName() ¶ protected
entityName(string $name): string
Creates the proper entity name (singular) for the specified name
Parameters
-
string$name Name
Returns
stringCamelized and plural model name
fixtureName() ¶ protected
fixtureName(string $name): string
Creates a fixture name
Parameters
-
string$name Model class name
Returns
stringSingular model key
modelKey() ¶ protected
modelKey(string $name): string
Creates the proper underscored model key for associations
If the input contains a dot, assume that the right side is the real table name.
Parameters
-
string$name Model class name
Returns
stringSingular model key
modelNameFromKey() ¶ protected
modelNameFromKey(string $key): string
Creates the proper model name from a foreign key
Parameters
-
string$key Foreign key
Returns
stringModel name
pluginNamespace() ¶ protected
pluginNamespace(string $pluginName): string
Return plugin's namespace
Parameters
-
string$pluginName Plugin name
Returns
stringPlugin's namespace
pluginPath() ¶ protected
pluginPath(string $pluginName): string
Find the correct path for a plugin. Scans $pluginPaths for the plugin you want.
Parameters
-
string$pluginName Name of the plugin you want ie. DebugKit
Returns
stringPath to the correct plugin.
pluralHumanName() ¶ protected
pluralHumanName(string $name): string
Creates the plural human name used in views
Parameters
-
string$name Controller name
Returns
stringPlural human name
singularHumanName() ¶ protected
singularHumanName(string $name): string
Creates the singular human name used in views
Parameters
-
string$name Controller name
Returns
stringSingular human name
singularName() ¶ protected
singularName(string $name): string
Creates the singular name for use in views.
Parameters
-
string$name Name to use
Returns
stringVariable name
variableName() ¶ protected
variableName(string $name): string
Creates the plural variable name for views
Parameters
-
string$name Name to use
Returns
stringPlural name for views