CakePHP
  • 文档
    • 书籍
    • API
    • 视频
    • 报告安全问题
    • 隐私政策
    • 标识和商标
  • 商业解决方案
  • 周边产品
  • 公路旅行
  • 团队
  • 社区
    • 社区
    • 参与其中
    • 问题 (Github)
    • 烘焙坊
    • 精选资源
    • 培训
    • 聚会
    • 我的 CakePHP
    • CakeFest
    • 时事通讯
    • 领英
    • 优酷
    • 脸书
    • 推特
    • Mastodon
    • 帮助和支持
    • 论坛
    • 堆栈溢出
    • IRC
    • Slack
    • 付费支持
CakePHP

C Queue 2.x API

  • 项目
    • Queue
      • CakePHP
      • Chronos
      • Elastic Search
      • Queue
  • 版本
    • 2.x
      • 2.x
      • 1.x

命名空间

  • Cake\Queue
    • Command
    • Consumption
    • Job
    • Listener
    • Mailer
      • Transport
    • Model
    • Queue

类 QueueTransport

命名空间: Cake\Queue\Mailer\Transport

属性摘要

  • $_config protected
    array<string, mixed>

    运行时配置

  • $_configInitialized protected
    bool

    配置属性是否已使用默认值配置

  • $_defaultConfig protected
    array<string, mixed>

    此类的默认配置

方法摘要

  • __construct() public

    构造函数

  • _configDelete() protected

    删除单个配置键。

  • _configRead() protected

    读取配置键。

  • _configWrite() protected

    写入配置键。

  • checkRecipient() protected

    检查是否至少设置了一个目标头。

  • configShallow() public

    将提供的配置与现有配置合并。与 `config()` 对嵌套键执行递归合并不同,此方法执行简单的合并。

  • enqueueJob() protected

    将作业添加到队列

  • getConfig() public

    返回配置。

  • getConfigOrFail() public

    返回此特定键的配置。

  • prepareData() protected

    准备作业数据

  • send() public

    发送邮件

  • setConfig() public

    设置配置。

方法详细

__construct() ¶ public

__construct(array<string, mixed> $config = [])

构造函数

参数
array<string, mixed> $config 可选

配置选项。

_configDelete() ¶ protected

_configDelete(string $key): void

删除单个配置键。

参数
string $key

要删除的键。

返回值
void
抛出
Cake\Core\Exception\CakeException
如果尝试覆盖现有配置

_configRead() ¶ protected

_configRead(string|null $key): mixed

读取配置键。

参数
string|null $key

要读取的键。

返回值
mixed

_configWrite() ¶ protected

_configWrite(array<string, mixed>|string $key, mixed $value, string|bool $merge = false): void

写入配置键。

参数
array<string, mixed>|string $key

要写入的键。

mixed $value

要写入的值。

string|bool $merge 可选

是否递归合并(True)、简单合并('shallow')或覆盖(False),默认为 False。

返回值
void
抛出
Cake\Core\Exception\CakeException
如果尝试覆盖现有配置

checkRecipient() ¶ protected

checkRecipient(Cake\Mailer\Message $message): void

检查是否至少设置了一个目标头。

参数
Cake\Mailer\Message $message

消息实例。

返回值
void
抛出
Cake\Core\Exception\CakeException
如果 to、cc 或 bcc 中至少有一个未指定。

configShallow() ¶ public

configShallow(array<string, mixed>|string $key, mixed|null $value = null): $this

将提供的配置与现有配置合并。与 `config()` 对嵌套键执行递归合并不同,此方法执行简单的合并。

设置特定值

$this->configShallow('key', $value);

设置嵌套值

$this->configShallow('some.nested.key', $value);

同时更新多个配置设置

$this->configShallow(['one' => 'value', 'another' => 'value']);
参数
array<string, mixed>|string $key

要设置的键,或完整的配置数组。

mixed|null $value 可选

要设置的值。

返回值
$this

enqueueJob() ¶ protected

enqueueJob(array $data, array $options): void

将作业添加到队列

参数
array $data

要发送到作业的数据

array $options

作业选项

返回值
void

getConfig() ¶ public

getConfig(string|null $key = null, mixed $default = null): mixed

返回配置。

用法

读取整个配置

$this->getConfig();

读取特定值

$this->getConfig('key');

读取嵌套值

$this->getConfig('some.nested.key');

使用默认值读取

$this->getConfig('some-key', 'default-value');
参数
string|null $key 可选

要获取的键,或获取整个配置时为 null。

mixed $default 可选

键不存在时的返回值。

返回值
mixed

getConfigOrFail() ¶ public

getConfigOrFail(string $key): mixed

返回此特定键的配置。

此键的配置值必须存在,不能为 null。

参数
string $key

要获取的键。

返回值
mixed
抛出
InvalidArgumentException

prepareData() ¶ protected

prepareData(Cake\Mailer\Message $message): array

准备作业数据

参数
Cake\Mailer\Message $message

电子邮件消息

返回值
array

send() ¶ public

send(Cake\Mailer\Message $message): array

发送邮件

参数
Cake\Mailer\Message $message
返回值
array

setConfig() ¶ public

setConfig(array<string, mixed>|string $key, mixed|null $value = null, bool $merge = true): $this

设置配置。

用法

设置特定值

$this->setConfig('key', $value);

设置嵌套值

$this->setConfig('some.nested.key', $value);

同时更新多个配置设置

$this->setConfig(['one' => 'value', 'another' => 'value']);
参数
array<string, mixed>|string $key

要设置的键,或完整的配置数组。

mixed|null $value 可选

要设置的值。

bool $merge 可选

是否递归合并或覆盖现有配置,默认为 True。

返回值
$this
抛出
Cake\Core\Exception\CakeException
尝试设置无效键时。

属性详细

$_config ¶ protected

运行时配置

类型
array<string, mixed>

$_configInitialized ¶ protected

配置属性是否已使用默认值配置

类型
bool

$_defaultConfig ¶ protected

此类的默认配置

类型
array<string, mixed>
OpenHub
Pingping
Linode
  • 商业解决方案
  • 展示
  • 文档
  • 书籍
  • API
  • 视频
  • 报告安全问题
  • 隐私政策
  • 标识和商标
  • 社区
  • 参与其中
  • 问题 (Github)
  • 烘焙坊
  • 精选资源
  • 培训
  • 聚会
  • 我的 CakePHP
  • CakeFest
  • 时事通讯
  • 领英
  • 优酷
  • 脸书
  • 推特
  • Mastodon
  • 帮助和支持
  • 论坛
  • 堆栈溢出
  • IRC
  • Slack
  • 付费支持

使用 CakePHP API 文档 生成