PHP Class Cake\ElasticSearch\Datasource\MappingSchema

Show file Open project: cakephp/elastic-search

Protected Properties

Property Type Description
$data array The raw mapping data from elasticsearch
$name string The name of the type this mapping data is for.

Public Methods

Method Description
__construct ( string $name, array $data ) Constructor
field ( string $name ) : array | null Get the mapping information for a single field.
fieldType ( string $name ) : string | null Get the field type for a field.
fields ( ) : array Get the field names in the mapping.
name ( ) : string Get the name of the type for this mapping.

Method Details

__construct() public method

Constructor
public __construct ( string $name, array $data )
$name string The name of the type of the mapping data
$data array The mapping data from elasticsearch

field() public method

Can access nested fields through dot paths.
public field ( string $name ) : array | null
$name string The path to the field you want.
return array | null Either field mapping data or null.

fieldType() public method

Can access nested fields through dot paths.
public fieldType ( string $name ) : string | null
$name string The path to the field you want.
return string | null Either type information or null

fields() public method

Will only return the top level fields. Nested object field names will not be included.
public fields ( ) : array
return array

name() public method

Get the name of the type for this mapping.
public name ( ) : string
return string

Property Details

$data protected property

The raw mapping data from elasticsearch
protected array $data
return array

$name protected property

The name of the type this mapping data is for.
protected string $name
return string