W3cubDocs

/Symfony 2.8

Symfony\Component\PropertyAccess\PropertyAccessorBuilder

class PropertyAccessorBuilder

A configurable builder to create a PropertyAccessor.

Methods

PropertyAccessorBuilder enableMagicCall()

Enables the use of "__call" by the PropertyAccessor.

PropertyAccessorBuilder disableMagicCall()

Disables the use of "__call" by the PropertyAccessor.

bool isMagicCallEnabled()
PropertyAccessorBuilder enableExceptionOnInvalidIndex()

Enables exceptions when reading a non-existing index.

PropertyAccessorBuilder disableExceptionOnInvalidIndex()

Disables exceptions when reading a non-existing index.

bool isExceptionOnInvalidIndexEnabled()
PropertyAccessorInterface getPropertyAccessor()

Builds and returns a new PropertyAccessor object.

Details

public PropertyAccessorBuilder enableMagicCall()

Enables the use of "__call" by the PropertyAccessor.

Return Value

PropertyAccessorBuilder The builder object

public PropertyAccessorBuilder disableMagicCall()

Disables the use of "__call" by the PropertyAccessor.

Return Value

PropertyAccessorBuilder The builder object

public bool isMagicCallEnabled()

Return Value

bool whether the use of "__call" by the PropertyAccessor is enabled

public PropertyAccessorBuilder enableExceptionOnInvalidIndex()

Enables exceptions when reading a non-existing index.

This has no influence on writing non-existing indices with PropertyAccessorInterface::setValue() which are always created on-the-fly.

Return Value

PropertyAccessorBuilder The builder object

public PropertyAccessorBuilder disableExceptionOnInvalidIndex()

Disables exceptions when reading a non-existing index.

Instead, null is returned when calling PropertyAccessorInterface::getValue() on a non-existing index.

Return Value

PropertyAccessorBuilder The builder object

public bool isExceptionOnInvalidIndexEnabled()

Return Value

bool whether an exception is thrown or null is returned when reading a non-existing index

public PropertyAccessorInterface getPropertyAccessor()

Builds and returns a new PropertyAccessor object.

Return Value

PropertyAccessorInterface The built PropertyAccessor

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.8/Symfony/Component/PropertyAccess/PropertyAccessorBuilder.html