Trait ConventionsTrait
Provides methods that allow other classes access to conventions based inflections.
Direct Users
Indirect Users
- Cake\ORM\Association\BelongsTo
- Cake\ORM\Association\BelongsToMany
- Cake\ORM\Association\HasMany
- Cake\ORM\Association\HasOne
Method Summary
- _camelize() protectedCreates a camelized version of $name
- _entityName() protectedCreates the proper entity name (singular) for the specified name
- _fixtureName() protectedCreates a fixture name
- _modelKey() protectedCreates the proper underscored model key for associations
- _modelNameFromKey() protectedCreates the proper model name from a foreign key
- _pluginNamespace() protectedReturn plugin's namespace
- _pluginPath() protectedFind the correct path for a plugin. Scans $pluginPaths for the plugin you want.
- _pluralHumanName() protectedCreates the plural human name used in views
- _singularHumanName() protectedCreates the singular human name used in views
- _singularName() protectedCreates the singular name for use in views.
- _variableName() protectedCreates the plural variable name for views
Method Detail
_camelize()source protected
_camelize( string $name )
Creates a camelized version of $name
Parameters
- string
$name
- name
Returns
stringCamelized name
_entityName()source protected
_entityName( string $name )
Creates the proper entity name (singular) for the specified name
Parameters
- string
$name
- Name
Returns
stringCamelized and plural model name
_fixtureName()source protected
_fixtureName( string $name )
Creates a fixture name
Parameters
- string
$name
- Model class name
Returns
stringSingular model key
_modelKey()source protected
_modelKey( string $name )
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()source protected
_modelNameFromKey( string $key )
Creates the proper model name from a foreign key
Parameters
- string
$key
- Foreign key
Returns
stringModel name
_pluginNamespace()source protected
_pluginNamespace( string $pluginName )
Return plugin's namespace
Parameters
- string
$pluginName
- Plugin name
Returns
stringPlugin's namespace
_pluginPath()source protected
_pluginPath( string $pluginName )
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 path to the correct plugin.
_pluralHumanName()source protected
_pluralHumanName( string $name )
Creates the plural human name used in views
Parameters
- string
$name
- Controller name
Returns
stringPlural human name
_singularHumanName()source protected
_singularHumanName( string $name )
Creates the singular human name used in views
Parameters
- string
$name
- Controller name
Returns
stringSingular human name
_singularName()source protected
_singularName( string $name )
Creates the singular name for use in views.
Parameters
- string
$name
- Name to use
Returns
stringVariable name
_variableName()source protected
_variableName( string $name )
Creates the plural variable name for views
Parameters
- string
$name
- Name to use
Returns
stringPlural name for views
© 2005–2017 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/3.4/class-Cake.Core.ConventionsTrait.html