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

PropertyAccessorBuilder enableMagicCall()

Enables the use of "__call" by the PropertyAccessor.

Return Value

PropertyAccessorBuilder The builder object

PropertyAccessorBuilder disableMagicCall()

Disables the use of "__call" by the PropertyAccessor.

Return Value

PropertyAccessorBuilder The builder object

bool isMagicCallEnabled()

Return Value

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

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

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

bool isExceptionOnInvalidIndexEnabled()

Return Value

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

PropertyAccessorInterface getPropertyAccessor()

Builds and returns a new PropertyAccessor object.

Return Value

PropertyAccessorInterface The built PropertyAccessor

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