/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/ORM/Locator
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/ORM/Locator/LocatorAwareTrait.php (2905B)
_tableLocator = $tableLocator;
return $this;
}
/**
* Gets the table locator.
*
* @return \Cake\ORM\Locator\LocatorInterface
*/
public function getTableLocator(): LocatorInterface
{
if ($this->_tableLocator === null) {
/** @psalm-suppress InvalidPropertyAssignmentValue */
$this->_tableLocator = FactoryLocator::get('Table');
}
/** @var \Cake\ORM\Locator\LocatorInterface */
return $this->_tableLocator;
}
/**
* Convenience method to get a table instance.
*
* @param string|null $alias The alias name you want to get. Should be in CamelCase format.
* If `null` then the value of $defaultTable property is used.
* @param array
$options The options you want to build the table with.
* If a table has already been loaded the registry options will be ignored.
* @return \Cake\ORM\Table
* @throws \Cake\Core\Exception\CakeException If `$alias` argument and `$defaultTable` property both are `null`.
* @see \Cake\ORM\TableLocator::get()
* @since 4.3.0
*/
public function fetchTable(?string $alias = null, array $options = []): Table
{
$alias = $alias ?? $this->defaultTable;
if (empty($alias)) {
throw new UnexpectedValueException(
'You must provide an `$alias` or set the `$defaultTable` property to a non empty string.'
);
}
return $this->getTableLocator()->get($alias, $options);
}
}