Trait ConventionsTrait

Provides methods that allow other classes access to conventions based inflections.

Namespace: Cake\Core

Method Summary

Method Detail

_camelize() protected

_camelize(mixed $name)

Creates a camelized version of $name

Parameters

string $name

name

Returns

string

Camelized name

_entityName() protected

_entityName(mixed $name)

Creates the proper entity name (singular) for the specified name

Parameters

string $name

Name

Returns

string

Camelized and plural model name

_fixtureName() protected

_fixtureName(mixed $name)

Creates a fixture name

Parameters

string $name

Model class name

Returns

string

Singular model key

_modelKey() protected

_modelKey(mixed $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

string

Singular model key

_modelNameFromKey() protected

_modelNameFromKey(mixed $key)

Creates the proper model name from a foreign key

Parameters

string $key

Foreign key

Returns

string

Model name

_pluginNamespace() protected

_pluginNamespace(mixed $pluginName)

Return plugin's namespace

Parameters

string $pluginName

Plugin name

Returns

string

Plugin's namespace

_pluginPath() protected

_pluginPath(mixed $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

string

path path to the correct plugin.

_pluralHumanName() protected

_pluralHumanName(mixed $name)

Creates the plural human name used in views

Parameters

string $name

Controller name

Returns

string

Plural human name

_singularHumanName() protected

_singularHumanName(mixed $name)

Creates the singular human name used in views

Parameters

string $name

Controller name

Returns

string

Singular human name

_singularName() protected

_singularName(mixed $name)

Creates the singular name for use in views.

Parameters

string $name

Name to use

Returns

string

Variable name

_variableName() protected

_variableName(mixed $name)

Creates the plural variable name for views

Parameters

string $name

Name to use

Returns

string

Plural name for views

© 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/3.9/trait-Cake.Core.ConventionsTrait.html