类 EmbedOne
表示一个仅包含一个实例的嵌入文档。
属性摘要
-
$alias protected
字符串
此关联使用的别名。
-
$entityClass protected
字符串
用于嵌入文档的类。
-
$indexClass protected
字符串
此嵌入链接到的索引类
-
$property protected
字符串
嵌入文档所在的属性。
方法摘要
-
__construct() public
构造函数
-
entityClass() public deprecated
获取/设置此嵌入使用的实体/文档类。
-
getAlias() public
获取此嵌入的别名。
-
getEntityClass() public
获取此嵌入使用的实体/文档类。
-
getIndexClass() public
获取此嵌入使用的索引类。
-
getProperty() public
获取此嵌入附加到的属性。
-
hydrate() public
从父文档数据中提取实例。
-
indexClass() public deprecated
获取/设置此嵌入使用的索引类。
-
property() public deprecated
获取/设置此嵌入附加到的属性。
-
setEntityClass() public
设置此嵌入使用的实体/文档类。
-
setIndexClass() public
设置此嵌入使用的索引类。
-
setProperty() public
设置此嵌入附加到的属性。
-
type() public
获取此关联的类型。
方法详细
__construct() ¶ public
__construct(string $alias, array $options = [])
构造函数
参数
-
字符串
$alias 嵌入文档的别名/名称。
-
数组
$options 可选 嵌入文档的选项。
entityClass() ¶ public
entityClass(string|null $name = null): string
获取/设置此嵌入使用的实体/文档类。
参数
-
字符串|空
$name 可选 要设置的类名。
返回
字符串
hydrate() ¶ public
hydrate(array $data, array $options): Cake\ElasticSearch\Document
从父文档数据中提取实例。
参数
-
数组
$data 用于嵌入文档的数据。
-
数组
$options 用于新文档的选项。
返回
Cake\ElasticSearch\Document
indexClass() ¶ public
indexClass(Cake\ElasticSearch\Index|string|null $name = null): string
获取/设置此嵌入使用的索引类。
参数
-
Cake\ElasticSearch\Index|字符串|空
$name 可选 要设置的类名。
返回
字符串
property() ¶ public
property(string|null $name = null): string
获取/设置此嵌入附加到的属性。
参数
-
字符串|空
$name 可选 要设置的属性名称。
返回
字符串
setEntityClass() ¶ public
setEntityClass(string $name): $this
设置此嵌入使用的实体/文档类。
参数
-
字符串
$name 要使用的类的名称
返回
$this
setIndexClass() ¶ public
setIndexClass(Cake\ElasticSearch\Index|string|null $name): $this
设置此嵌入使用的索引类。
参数
-
Cake\ElasticSearch\Index|字符串|空
$name 要设置的类名。
返回
$this
setProperty() ¶ public
setProperty(string|null $name = null): $this
设置此嵌入附加到的属性。
参数
-
字符串|空
$name 可选 要设置的属性名称。
返回
$this