PropertyAccessorBuilder::enableExceptionOnInvalidIndex()

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

PropertyAccessor::setValue()

setValue(object|array $objectOrArray, string|PropertyPathInterface $propertyPath, mixed $value) Sets the value at the end of the property path of the object graph. Example: use Symfony\Component\PropertyAccess\PropertyAccess; $propertyAccessor = PropertyAccess::createPropertyAccessor(); echo $propertyAccessor->setValue($object, 'child.name', 'Fabien'); // equals echo $object->getChild()->setName('Fabien'); This method first tries to find a public setter for each property

PropertyAccessor::isWritable()

bool isWritable(object|array $objectOrArray, string|PropertyPathInterface $propertyPath) Returns whether a value can be written at a given property path. Whenever this method returns true, {@link setValue()} is guaranteed not to throw an exception when called with the same arguments. Parameters object|array $objectOrArray The object or array to check string|PropertyPathInterface $propertyPath The property path to check Return Value bool Whether the value can be set Exceptions

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 disableExceptionOnInvalidInd

PropertyAccessor::handleError()

static handleError($type, $message, $file, $line, $context) Parameters $type $message $file $line $context

PropertyAccessor::getValue()

mixed getValue(object|array $objectOrArray, string|PropertyPathInterface $propertyPath) Returns the value at the end of the property path of the object graph. Example: use Symfony\Component\PropertyAccess\PropertyAccess; $propertyAccessor = PropertyAccess::createPropertyAccessor(); echo $propertyAccessor->getValue($object, 'child.name); // equals echo $object->getChild()->getName(); This method first tries to find a public getter for each property in the path. The nam

PropertyAccessor::isReadable()

bool isReadable(object|array $objectOrArray, string|PropertyPathInterface $propertyPath) Returns whether a property path can be read from an object graph. Whenever this method returns true, {@link getValue()} is guaranteed not to throw an exception when called with the same arguments. Parameters object|array $objectOrArray The object or array to check string|PropertyPathInterface $propertyPath The property path to check Return Value bool Whether the property path can be read E

PropertyAccessor

class PropertyAccessor implements PropertyAccessorInterface Default implementation of {@link PropertyAccessorInterface}. Constants VALUE REF IS_REF_CHAINED ACCESS_HAS_PROPERTY ACCESS_TYPE ACCESS_NAME ACCESS_REF ACCESS_ADDER ACCESS_REMOVER ACCESS_TYPE_METHOD ACCESS_TYPE_PROPERTY ACCESS_TYPE_MAGIC ACCESS_TYPE_ADDER_AND_REMOVER ACCESS_TYPE_NOT_FOUND Methods __construct(bool $magicCall = false, bool $throwExceptionOnInvalidIndex = fal

PropertyAccessDecorator::getDecoratedFactory()

ChoiceListFactoryInterface getDecoratedFactory() Returns the decorated factory. Return Value ChoiceListFactoryInterface The decorated factory

PropertyAccessExtractorInterface

interface PropertyAccessExtractorInterface Guesses if the property can be accessed or mutated. Methods bool|null isReadable(string $class, string $property, array $context = array()) Is the property readable? bool|null isWritable(string $class, string $property, array $context = array()) Is the property writable? Details bool|null isReadable(string $class, string $property, array $context = array()) Is the property readable? Parameters s