ReflectionExtractor
class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTypeExtractorInterface, PropertyAccessExtractorInterface
Извлекает данные с помощью API рефлексии.
Свойства
| static | $defaultMutatorPrefixes | ||
| static | $defaultAccessorPrefixes | ||
| static | $defaultArrayMutatorPrefixes |
Методы
| __construct(array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null, bool $enableConstructorExtraction = true) | ||
| string[]|null | getProperties(string $class, array $context = array()) Получает список свойств, доступных для данного класса. | |
| Type[]|null | getTypes(string $class, string $property, array $context = array()) Получает типы свойства. | |
| bool|null | isReadable(string $class, string $property, array $context = array()) Доступно ли свойство для чтения? | |
| bool|null | isWritable(string $class, string $property, array $context = array()) Доступно ли свойство для записи? |
Подробности
__construct(array $mutatorPrefixes = null, array $accessorPrefixes = null, array $arrayMutatorPrefixes = null, bool $enableConstructorExtraction = true)
Параметры
| array | $mutatorPrefixes | |
| array | $accessorPrefixes | |
| array | $arrayMutatorPrefixes | |
| bool | $enableConstructorExtraction |
string[]|null getProperties(string $class, array $context = array())
Получает список свойств, доступных для данного класса.
Параметры
| string | $class | |
| array | $context |
Возвращаемое значение
| string[]|null |
Type[]|null getTypes(string $class, string $property, array $context = array())
Получает типы свойства.
Параметры
| string | $class | |
| string | $property | |
| array | $context |
Возвращаемое значение
| Type[]|null |
bool|null isReadable(string $class, string $property, array $context = array())
Доступно ли свойство для чтения?
Параметры
| string | $class | |
| string | $property | |
| array | $context |
Возвращаемое значение
| bool|null |
bool|null isWritable(string $class, string $property, array $context = array())
Доступно ли свойство для записи?
Параметры
| string | $class | |
| string | $property | |
| array | $context |
Возвращаемое значение
| bool|null |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.html