Copied!

Default implementation of {@link PropertyAccessorInterface}.

CloneableInstantiable
Constants
public Symfony\Component\PropertyAccess\PropertyAccessor::DISALLOW_MAGIC_METHODS = 0
 
  • var int Allow none of the magic methods
public Symfony\Component\PropertyAccess\PropertyAccessor::DO_NOT_THROW = 0
public Symfony\Component\PropertyAccess\PropertyAccessor::MAGIC_CALL = 4
 
  • var int Allow magic __call methods
public Symfony\Component\PropertyAccess\PropertyAccessor::MAGIC_GET = 1
 
  • var int Allow magic __get methods
public Symfony\Component\PropertyAccess\PropertyAccessor::MAGIC_SET = 2
 
  • var int Allow magic __set methods
public Symfony\Component\PropertyAccess\PropertyAccessor::THROW_ON_INVALID_INDEX = 1
public Symfony\Component\PropertyAccess\PropertyAccessor::THROW_ON_INVALID_PROPERTY_PATH = 2
Methods
public __construct(int $magicMethods = 3, int $throw = 2self::THROW_ON_INVALID_PROPERTY_PATH, ?Psr\Cache\CacheItemPoolInterface $cacheItemPool = NULL, ?Symfony\Component\PropertyInfo\PropertyReadInfoExtractorInterface $readInfoExtractor = NULL, ?Symfony\Component\PropertyInfo\PropertyWriteInfoExtractorInterface $writeInfoExtractor = NULL)
 

Should not be used by application code. Use
{@link PropertyAccess::createPropertyAccessor()} instead.

  • param int $magicMethods A bitwise combination of the MAGIC_* constants
    to specify the allowed magic methods (get, set, __call)
    or self::DISALLOW_MAGIC_METHODS for none
  • param int $throw A bitwise combination of the THROW_* constants
    to specify when exceptions should be thrown
public static createCache(string $namespace, int $defaultLifetime, string $version, ?Psr\Log\LoggerInterface $logger = NULL) : Symfony\Component\Cache\Adapter\AdapterInterface
 

Creates the APCu adapter if applicable.

  • throws LogicException When the Cache Component isn't available
public getValue(object|array $objectOrArray, Symfony\Component\PropertyAccess\PropertyPathInterface|string $propertyPath) : ?mixed
 
    public isReadable(object|array $objectOrArray, Symfony\Component\PropertyAccess\PropertyPathInterface|string $propertyPath) : bool
     
      public isWritable(object|array $objectOrArray, Symfony\Component\PropertyAccess\PropertyPathInterface|string $propertyPath) : bool
       
        public setValue(object|array $objectOrArray, Symfony\Component\PropertyAccess\PropertyPathInterface|string $propertyPath, ?mixed $value)
         
          Constants
          private Symfony\Component\PropertyAccess\PropertyAccessor::CACHE_PREFIX_PROPERTY_PATH = 'p'
          private Symfony\Component\PropertyAccess\PropertyAccessor::CACHE_PREFIX_READ = 'r'
          private Symfony\Component\PropertyAccess\PropertyAccessor::CACHE_PREFIX_WRITE = 'w'
          private Symfony\Component\PropertyAccess\PropertyAccessor::IS_REF_CHAINED = 2
          private Symfony\Component\PropertyAccess\PropertyAccessor::REF = 1
          private Symfony\Component\PropertyAccess\PropertyAccessor::RESULT_PROTO = [NULL]
          private Symfony\Component\PropertyAccess\PropertyAccessor::VALUE = 0
          Properties
          private $cacheItemPool
           
          • var CacheItemPoolInterface
          private $ignoreInvalidIndices
          private $ignoreInvalidProperty
          private $magicMethodsFlags
          private $propertyPathCache
          private $readInfoExtractor
           
          • var PropertyReadInfoExtractorInterface
          private $readPropertyCache
          private $writeInfoExtractor
           
          • var PropertyWriteInfoExtractorInterface
          private $writePropertyCache
          Methods
          private getPropertyPath(Symfony\Component\PropertyAccess\PropertyPath|string $propertyPath) : Symfony\Component\PropertyAccess\PropertyPath
           

          Gets a PropertyPath instance and caches it.

          private getReadInfo(string $class, string $property) : ?Symfony\Component\PropertyInfo\PropertyReadInfo
           

          Guesses how to read the property value.

          private getWriteInfo(string $class, string $property, ?mixed $value) : Symfony\Component\PropertyInfo\PropertyWriteInfo
          private isPropertyWritable(object $object, string $property) : bool
           

          Returns whether a property is writable in the given object.

          private readIndex(array $zval, string|int $index) : array
           

          Reads a key from an array-like structure.

          • throws NoSuchIndexException If the array does not implement \ArrayAccess or it is not an array
          private readPropertiesUntil(array $zval, Symfony\Component\PropertyAccess\PropertyPathInterface $propertyPath, int $lastIndex, bool $ignoreInvalidIndices = true) : array
           

          Reads the path from an object up to a given path index.

          • throws UnexpectedTypeException if a value within the path is neither object nor array
          • throws NoSuchIndexException If a non-existing index is accessed
          private readProperty(array $zval, string $property, bool $ignoreInvalidProperty = false) : array
           

          Reads the value of a property from an object.

          • throws NoSuchPropertyException If $ignoreInvalidProperty is false and the property does not exist or is not public
          private static throwInvalidArgumentException(string $message, array $trace, int $i, string $propertyPath, ?Throwable $previous = NULL) : void
          private writeCollection(array $zval, string $property, iterable $collection, Symfony\Component\PropertyInfo\PropertyWriteInfo $addMethod, Symfony\Component\PropertyInfo\PropertyWriteInfo $removeMethod)
           

          Adjusts a collection-valued property by calling add() and remove() methods.

          private writeIndex(array $zval, string|int $index, ?mixed $value)
           

          Sets the value of an index in a given array-accessible value.

          • throws NoSuchIndexException If the array does not implement \ArrayAccess or it is not an array
          private writeProperty(array $zval, string $property, ?mixed $value)
           

          Sets the value of a property in the given object.

          • throws NoSuchPropertyException if the property does not exist or is not public
          Methods
          public static createCache(string $namespace, int $defaultLifetime, string $version, ?Psr\Log\LoggerInterface $logger = NULL) : Symfony\Component\Cache\Adapter\AdapterInterface
           

          Creates the APCu adapter if applicable.

          • throws LogicException When the Cache Component isn't available
          private static throwInvalidArgumentException(string $message, array $trace, int $i, string $propertyPath, ?Throwable $previous = NULL) : void
          © 2022 Bruce Wells
          Search Namespaces \ Classes
          Configuration