PHP Class Cake\ElasticSearch\View\Form\DocumentContext

Inheritance: implements Cake\View\Form\ContextInterface
Show file Open project: cakephp/elastic-search

Protected Properties

Property Type Description
$_context array The context data
$_isCollection boolean Boolean to track whether or not the entity is a collection.
$_request Cake\Network\Request The request object.
$_rootName string The name of the top level entity/type object.

Public Methods

Method Description
__construct ( Cake\Network\Request $request, array $context ) Constructor.
attributes ( $field ) {@inheritDoc}
error ( $field ) {@inheritDoc}
fieldNames ( ) {@inheritDoc}
hasError ( $field ) {@inheritDoc}
isCreate ( ) {@inheritDoc}
isPrimaryKey ( $field ) {@inheritDoc}
isRequired ( $field ) {@inheritDoc}
primaryKey ( ) {@inheritDoc}
type ( $field ) {@inheritDoc}
val ( $field ) {@inheritDoc}

Protected Methods

Method Description
_prepare ( ) : void Prepare some additional data from the context.
entity ( array $path ) : Cake\Datasource\EntityInterface | false Get the entity that is closest to $path.
getProp ( mixed $target, string $field ) : mixed Read property values or traverse arrays/iterators.
getValidator ( ) : Cake\Validation\Validator Get the validator for the current type.

Method Details

__construct() public method

Constructor.
public __construct ( Cake\Network\Request $request, array $context )
$request Cake\Network\Request The request object.
$context array Context info.

_prepare() protected method

If the table option was provided to the constructor and it was a string, TypeRegistry will be used to get the correct table instance. If an object is provided as the type option, it will be used as is. If no type option is provided, the type name will be derived based on naming conventions. This inference will work with a number of common objects like arrays, Collection objects and ResultSets.
protected _prepare ( ) : void
return void

attributes() public method

{@inheritDoc}
public attributes ( $field )

entity() protected method

Get the entity that is closest to $path.
protected entity ( array $path ) : Cake\Datasource\EntityInterface | false
$path array The to get an entity for.
return Cake\Datasource\EntityInterface | false The entity or false.

error() public method

{@inheritDoc}
public error ( $field )

fieldNames() public method

{@inheritDoc}
public fieldNames ( )

getProp() protected method

Read property values or traverse arrays/iterators.
protected getProp ( mixed $target, string $field ) : mixed
$target mixed The entity/array/collection to fetch $field from.
$field string The next field to fetch.
return mixed

getValidator() protected method

Get the validator for the current type.
protected getValidator ( ) : Cake\Validation\Validator
return Cake\Validation\Validator The validator for the type.

hasError() public method

{@inheritDoc}
public hasError ( $field )

isCreate() public method

{@inheritDoc}
public isCreate ( )

isPrimaryKey() public method

{@inheritDoc}
public isPrimaryKey ( $field )

isRequired() public method

{@inheritDoc}
public isRequired ( $field )

primaryKey() public method

{@inheritDoc}
public primaryKey ( )

type() public method

{@inheritDoc}
public type ( $field )

val() public method

{@inheritDoc}
public val ( $field )

Property Details

$_context protected property

The context data
protected array $_context
return array

$_isCollection protected property

Boolean to track whether or not the entity is a collection.
protected bool $_isCollection
return boolean

$_request protected property

The request object.
protected Request,Cake\Network $_request
return Cake\Network\Request

$_rootName protected property

The name of the top level entity/type object.
protected string $_rootName
return string