On this page
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
_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
string
_entityName() protected
_entityName(string $name): string
Creates the proper entity name (singular) for the specified name
Parameters
string
$name-
Name
Returns
string
_fixtureName() protected
_fixtureName(string $name): string
Creates a fixture name
Parameters
string
$name-
Model class name
Returns
string
_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
string
_modelNameFromKey() protected
_modelNameFromKey(string $key): string
Creates the proper model name from a foreign key
Parameters
string
$key-
Foreign key
Returns
string
_pluginNamespace() protected
_pluginNamespace(string $pluginName): string
Return plugin's namespace
Parameters
string
$pluginName-
Plugin name
Returns
string
_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
string
_pluralHumanName() protected
_pluralHumanName(string $name): string
Creates the plural human name used in views
Parameters
string
$name-
Controller name
Returns
string
_singularHumanName() protected
_singularHumanName(string $name): string
Creates the singular human name used in views
Parameters
string
$name-
Controller name
Returns
string
_singularName() protected
_singularName(string $name): string
Creates the singular name for use in views.
Parameters
string
$name-
Name to use
Returns
string
_variableName() protected
_variableName(string $name): string
Creates the plural variable name for views
Parameters
string
$name-
Name to use
Returns
string
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/trait-Cake.Core.ConventionsTrait.html