类 FailedJobsListener
命名空间: Cake\Queue\Listener
属性摘要
-
$_tableLocator protected
Cake\ORM\Locator\LocatorInterface|null
表定位器实例
-
$defaultTable protected
string|null
此对象的默认表别名。
方法摘要
-
fetchTable() public
获取表实例的便捷方法。
-
getTableLocator() public
获取表定位器。
-
implementedEvents() public
返回此对象正在实现的事件列表。当该类在事件管理器中注册时,每个单独的方法将与相应的事件相关联。
-
setTableLocator() public
设置表定位器。
-
storeFailedJob() public
方法详情
fetchTable() ¶ public
fetchTable(string|null $alias = null, array<string, mixed> $options = []): Cake\ORM\Table
获取表实例的便捷方法。
参数
-
string|null
$alias optional 您要获取的别名。 应为驼峰命名法格式。 如果为
null
,则使用$defaultTable
属性的值。-
array<string, mixed>
$options optional 您要用来构建表的选项。 如果表已加载,则注册表选项将被忽略。
返回值
Cake\ORM\Table
抛出
Cake\Core\Exception\CakeException
如果
$alias
参数和 $defaultTable
属性都为 null
。另请参见
\Cake\ORM\TableLocator::get()
getTableLocator() ¶ public
getTableLocator(): Cake\ORM\Locator\LocatorInterface
获取表定位器。
返回值
Cake\ORM\Locator\LocatorInterface
implementedEvents() ¶ public
implementedEvents(): array<string, mixed>
返回此对象正在实现的事件列表。当该类在事件管理器中注册时,每个单独的方法将与相应的事件相关联。
示例
public function implementedEvents()
{
return [
'Order.complete' => 'sendEmail',
'Article.afterBuy' => 'decrementInventory',
'User.onRegister' => ['callable' => 'logRegistration', 'priority' => 20, 'passParams' => true]
];
}
返回值
array<string, mixed>
setTableLocator() ¶ public
setTableLocator(Cake\ORM\Locator\LocatorInterface $tableLocator): $this
设置表定位器。
参数
-
Cake\ORM\Locator\LocatorInterface
$tableLocator LocatorInterface 实例。
返回值
$this
storeFailedJob() ¶ public
storeFailedJob(Cake\Event\EventInterface $event): void
参数
-
Cake\Event\EventInterface
$event EventInterface。
返回值
void