CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C Elastic Search 2.x API

  • Project:
    • Elastic Search
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 2.x
      • 4.x
      • 3.x
      • 2.x

Namespaces

  • Cake\ElasticSearch
    • Association
    • Datasource
    • Rule
    • TestSuite
    • View

Class EmbedOne

Represents an embedded document that only contains one instance.

Namespace: Cake\ElasticSearch\Association

Constants

  • string
    ONE_TO_MANY ¶
    'oneToMany'

    Type name for many embedded documents.

  • string
    ONE_TO_ONE ¶
    'oneToOne'

    Type name for a single embedded document.

Property Summary

  • $alias protected
    string

    The alias this association uses.

  • $entityClass protected
    string

    The class to use for the embeded document.

  • $indexClass protected
    string

    The index class this embed is linked to

  • $property protected
    string

    The property the embedded document is located under.

Method Summary

  • __construct() public

    Constructor

  • alias() public

    Get the alias for this embed.

  • entityClass() public

    Get/set the entity/document class used for this embed.

  • getAlias() public

    Get the alias for this embed.

  • getEntityClass() public

    Get the entity/document class used for this embed.

  • getIndexClass() public

    Get the index class used for this embed.

  • getProperty() public

    Get the property this embed is attached to.

  • hydrate() public

    Hydrate an instance from the parent documents data.

  • indexClass() public

    Get/set the index class used for this embed.

  • property() public

    Get/set the property this embed is attached to.

  • setEntityClass() public

    Sets the entity/document class used for this embed.

  • setIndexClass() public

    Set the index class used for this embed.

  • setProperty() public

    Set the property this embed is attached to.

  • type() public

    Get the type of association this is.

Method Detail

__construct() ¶ public

__construct(string $alias, array $options = [])

Constructor

Parameters
string $alias

The alias/name for the embedded document.

array $options optional

The options for the embedded document.

alias() ¶ public

alias(): string

Get the alias for this embed.

Returns
string

entityClass() ¶ public

entityClass(string|null $name = null): string

Get/set the entity/document class used for this embed.

Parameters
string|null $name optional

The class name to set.

Returns
string

getAlias() ¶ public

getAlias(): string

Get the alias for this embed.

Returns
string

getEntityClass() ¶ public

getEntityClass(): string

Get the entity/document class used for this embed.

Returns
string

getIndexClass() ¶ public

getIndexClass(): string

Get the index class used for this embed.

Returns
string

getProperty() ¶ public

getProperty(): string

Get the property this embed is attached to.

Returns
string

hydrate() ¶ public

hydrate(array $data, array $options): Cake\ElasticSearch\Document

Hydrate an instance from the parent documents data.

Parameters
array $data

The data to use in the embedded document.

array $options

The options to use in the new document.

Returns
Cake\ElasticSearch\Document

indexClass() ¶ public

indexClass(string|null|Cake\ElasticSearch\Index $name = null): string

Get/set the index class used for this embed.

Parameters
string|null|Cake\ElasticSearch\Index $name optional

The class name to set.

Returns
string

property() ¶ public

property(string|null $name = null): string

Get/set the property this embed is attached to.

Parameters
string|null $name optional

The property name to set.

Returns
string

setEntityClass() ¶ public

setEntityClass(string $name): $this

Sets the entity/document class used for this embed.

Parameters
string $name

The name of the class to use

Returns
$this

setIndexClass() ¶ public

setIndexClass(string|null|Cake\ElasticSearch\Index $name): $this

Set the index class used for this embed.

Parameters
string|null|Cake\ElasticSearch\Index $name

The class name to set.

Returns
$this

setProperty() ¶ public

setProperty(string|null $name = null): string

Set the property this embed is attached to.

Parameters
string|null $name optional

The property name to set.

Returns
string

type() ¶ public

type(): string

Get the type of association this is.

Returns one of the association type constants.

Returns
string

Property Detail

$alias ¶ protected

The alias this association uses.

Type
string

$entityClass ¶ protected

The class to use for the embeded document.

Type
string

$indexClass ¶ protected

The index class this embed is linked to

Type
string

$property ¶ protected

The property the embedded document is located under.

Type
string
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs