Fr3nch13/CakePHP Utilities

LocatorAwareTrait

Contains method for setting and accessing LocatorInterface instance

Table of Contents

Properties

$_tableLocator  : LocatorInterface|null
Table locator instance
$defaultTable  : string|null
This object's default table alias.

Methods

fetchTable()  : Table
Convenience method to get a table instance.
getTableLocator()  : LocatorInterface
Gets the table locator.
setTableLocator()  : $this
Sets the table locator.

Properties

$defaultTable

This object's default table alias.

protected string|null $defaultTable = null

Methods

fetchTable()

Convenience method to get a table instance.

public fetchTable([string|null $alias = null ][, array<string, mixed> $options = [] ]) : Table
Parameters
$alias : string|null = null

The alias name you want to get. Should be in CamelCase format. If null then the value of $defaultTable property is used.

$options : array<string, mixed> = []

The options you want to build the table with. If a table has already been loaded the registry options will be ignored.

Tags
throws
CakeException

If $alias argument and $defaultTable property both are null.

see
TableLocator::get()
since
4.3.0
Return values
Table

        
On this page

Search results