PHP 클래스 Cake\ElasticSearch\Marshaller

Useful when converting request data into documents.
파일 보기 프로젝트 열기: cakephp/elastic-search

보호된 프로퍼티들

프로퍼티 타입 설명
$type Type Type instance this marshaller is for.

공개 메소드들

메소드 설명
__construct ( Type $type ) Constructor
many ( array $data, array $options = [] ) : array Hydrate a collection of entities.
merge ( Cake\Datasource\EntityInterface $entity, array $data, array $options = [] ) : Cake\Datasource\EntityInterface Merges $data into $document.
mergeMany ( array $entities, array $data, array $options = [] ) : array Update a collection of entities.
one ( array $data, array $options = [] ) : Cake\ElasticSearch\Document; Hydrate a single document.

보호된 메소드들

메소드 설명
_prepareDataAndOptions ( array $data, array $options ) : array Returns data and options prepared to validate and marshall.
_validate ( array $data, array $options, boolean $isNew ) : array Returns the validation errors for a data set based on the passed options
mergeNested ( Embedded $embed, Document | array $existing, array $data ) : array | Document Merge an embedded document.
newNested ( Embedded $embed, array $data ) : array | Document Marshal an embedded document.

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( Type $type )
$type Type The type instance this marshaller is for.

_prepareDataAndOptions() 보호된 메소드

Returns data and options prepared to validate and marshall.
protected _prepareDataAndOptions ( array $data, array $options ) : array
$data array The data to prepare.
$options array The options passed to this marshaller.
리턴 array An array containing prepared data and options.

_validate() 보호된 메소드

Returns the validation errors for a data set based on the passed options
protected _validate ( array $data, array $options, boolean $isNew ) : array
$data array The data to validate.
$options array The options passed to this marshaller.
$isNew boolean Whether it is a new entity or one to be updated.
리턴 array The list of validation errors.

many() 공개 메소드

### Options: * fieldList: A whitelist of fields to be assigned to the entity. If not present, the accessible fields list in the entity will be used. * accessibleFields: A list of fields to allow or deny in entity accessible fields.
public many ( array $data, array $options = [] ) : array
$data array A list of entity data you want converted into objects.
$options array Options
리턴 array An array of hydrated entities

merge() 공개 메소드

### Options: * fieldList: A whitelist of fields to be assigned to the entity. If not present the accessible fields list in the entity will be used. * associated: A list of embedded documents you want to marshal.
public merge ( Cake\Datasource\EntityInterface $entity, array $data, array $options = [] ) : Cake\Datasource\EntityInterface
$entity Cake\Datasource\EntityInterface the entity that will get the data merged in
$data array key value list of fields to be merged into the entity
$options array List of options.
리턴 Cake\Datasource\EntityInterface

mergeMany() 공개 메소드

Merges each of the elements from $data into each of the entities in $entities. Records in $data are matched against the entities using the id field. Entries in $entities that cannot be matched to any record in $data will be discarded. Records in $data that could not be matched will be marshalled as a new entity. ### Options: * fieldList: A whitelist of fields to be assigned to the entity. If not present, the accessible fields list in the entity will be used.
public mergeMany ( array $entities, array $data, array $options = [] ) : array
$entities array An array of Elasticsearch entities
$data array A list of entity data you want converted into objects.
$options array Options
리턴 array An array of merged entities

mergeNested() 보호된 메소드

Merge an embedded document.
protected mergeNested ( Embedded $embed, Document | array $existing, array $data ) : array | Document
$embed Cake\ElasticSearch\Association\Embedded The embed definition.
$existing Document | array The existing entity or entities.
$data array The data to marshal
리턴 array | Document Either a document or an array of documents.

newNested() 보호된 메소드

Marshal an embedded document.
protected newNested ( Embedded $embed, array $data ) : array | Document
$embed Cake\ElasticSearch\Association\Embedded The embed definition.
$data array The data to marshal
리턴 array | Document Either a document or an array of documents.

one() 공개 메소드

### Options: * fieldList: A whitelist of fields to be assigned to the entity. If not present, the accessible fields list in the entity will be used. * accessibleFields: A list of fields to allow or deny in entity accessible fields. * associated: A list of embedded documents you want to marshal.
public one ( array $data, array $options = [] ) : Cake\ElasticSearch\Document;
$data array The data to hydrate.
$options array List of options
리턴 Cake\ElasticSearch\Document;

프로퍼티 상세

$type 보호되어 있는 프로퍼티

Type instance this marshaller is for.
protected Type,Cake\ElasticSearch $type
리턴 Type