Fr3nch13/CakePHP Utilities

ConventionsTrait

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

Table of Contents

Methods

_camelize()  : string
Creates a camelized version of $name
_entityName()  : string
Creates the proper entity name (singular) for the specified name
_fixtureName()  : string
Creates a fixture name
_modelKey()  : string
Creates the proper underscored model key for associations
_modelNameFromKey()  : string
Creates the proper model name from a foreign key
_pluginNamespace()  : string
Return plugin's namespace
_pluginPath()  : string
Find the correct path for a plugin. Scans $pluginPaths for the plugin you want.
_pluralHumanName()  : string
Creates the plural human name used in views
_singularHumanName()  : string
Creates the singular human name used in views
_singularName()  : string
Creates the singular name for use in views.
_variableName()  : string
Creates the plural variable name for views

Methods

_camelize()

Creates a camelized version of $name

protected _camelize(string $name) : string
Parameters
$name : string

name

Return values
string

Camelized name

_entityName()

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

protected _entityName(string $name) : string
Parameters
$name : string

Name

Return values
string

Camelized and plural model name

_fixtureName()

Creates a fixture name

protected _fixtureName(string $name) : string
Parameters
$name : string

Model class name

Return values
string

Singular model key

_modelKey()

Creates the proper underscored model key for associations

protected _modelKey(string $name) : string

If the input contains a dot, assume that the right side is the real table name.

Parameters
$name : string

Model class name

Return values
string

Singular model key

_modelNameFromKey()

Creates the proper model name from a foreign key

protected _modelNameFromKey(string $key) : string
Parameters
$key : string

Foreign key

Return values
string

Model name

_pluginNamespace()

Return plugin's namespace

protected _pluginNamespace(string $pluginName) : string
Parameters
$pluginName : string

Plugin name

Return values
string

Plugin's namespace

_pluginPath()

Find the correct path for a plugin. Scans $pluginPaths for the plugin you want.

protected _pluginPath(string $pluginName) : string
Parameters
$pluginName : string

Name of the plugin you want ie. DebugKit

Return values
string

path path to the correct plugin.

_pluralHumanName()

Creates the plural human name used in views

protected _pluralHumanName(string $name) : string
Parameters
$name : string

Controller name

Return values
string

Plural human name

_singularHumanName()

Creates the singular human name used in views

protected _singularHumanName(string $name) : string
Parameters
$name : string

Controller name

Return values
string

Singular human name

_singularName()

Creates the singular name for use in views.

protected _singularName(string $name) : string
Parameters
$name : string

Name to use

Return values
string

Variable name

_variableName()

Creates the plural variable name for views

protected _variableName(string $name) : string
Parameters
$name : string

Name to use

Return values
string

Plural name for views


        
On this page

Search results