![]() |
TYPO3
7.6
|
Static Public Member Functions | |
static | getProperty ($subject, $propertyName, $forceDirectAccess=false) |
static | getPropertyInternal ($subject, $propertyName, $forceDirectAccess, &$propertyExists) |
static | getPropertyPath ($subject, $propertyPath) |
static | setProperty (&$subject, $propertyName, $propertyValue, $forceDirectAccess=false) |
static | getGettablePropertyNames ($object) |
static | getSettablePropertyNames ($object) |
static | isPropertySettable ($object, $propertyName) |
static | isPropertyGettable ($object, $propertyName) |
static | getGettableProperties ($object) |
static | buildSetterMethodName ($propertyName) |
Public Attributes | |
const | ACCESS_GET = 0 |
const | ACCESS_SET = 1 |
const | ACCESS_PUBLIC = 2 |
Provides methods to call appropriate getter/setter on an object given the property name. It does this following these rules:
Definition at line 27 of file ObjectAccess.php.
|
static |
Build the setter method name for a given property by capitalizing the first letter of the property, and prepending it with "set".
string | $propertyName | Name of the property |
Definition at line 381 of file ObjectAccess.php.
|
static |
Get all properties (names and their current values) of the current $object that are accessible through this class.
object | $object | Object to get all properties from. |
\InvalidArgumentException |
Definition at line 357 of file ObjectAccess.php.
Referenced by ControllerContext\extend().
|
static |
Returns an array of properties which can be get with the getProperty() method. Includes the following properties:
object | $object | Object to receive property names for |
\InvalidArgumentException |
Definition at line 232 of file ObjectAccess.php.
|
static |
Get a property of a given object. Tries to get the property the following ways:
mixed | $subject | Object or array to get the property from |
string | $propertyName | name of the property to retrieve |
bool | $forceDirectAccess | directly access property using reflection(!) |
Exception\PropertyNotAccessibleException | |
\InvalidArgumentException | in case $subject was not an object or $propertyName was not a string |
Definition at line 54 of file ObjectAccess.php.
Referenced by GenericObjectValidator\getPropertyValue().
|
static |
Gets a property of a given object or array. This is an internal method that does only limited type checking for performance reasons. If you can't make sure that $subject is either of type array or object and $propertyName of type string you should use getProperty() instead.
mixed | $subject | Object or array to get the property from |
string | $propertyName | name of the property to retrieve |
bool | $forceDirectAccess | directly access property using reflection(!) |
bool | &$propertyExists | (by reference) will be set to TRUE if the specified property exists and is gettable |
Exception\PropertyNotAccessibleException |
Definition at line 86 of file ObjectAccess.php.
References elseif.
|
static |
Gets a property path from a given object or array.
If propertyPath is "bla.blubb", then we first call getProperty($object, 'bla'), and on the resulting object we call getProperty(..., 'blubb')
For arrays the keys are checked likewise.
mixed | $subject | Object or array to get the property path from |
string | $propertyPath |
Definition at line 156 of file ObjectAccess.php.
Referenced by AbstractFormFieldViewHelper\addAdditionalIdentityPropertiesIfNeeded(), AbstractFormFieldViewHelper\getLastSubmittedFormData(), and AbstractFormFieldViewHelper\getPropertyValue().
|
static |
Returns an array of properties which can be set with the setProperty() method. Includes the following properties:
object | $object | Object to receive property names for |
\InvalidArgumentException |
Definition at line 272 of file ObjectAccess.php.
|
static |
Tells if the value of the specified property can be retrieved by this Object Accessor.
object | $object | Object containting the property |
string | $propertyName | Name of the property to check |
\InvalidArgumentException |
Definition at line 323 of file ObjectAccess.php.
References elseif.
Referenced by GenericObjectValidator\getPropertyValue().
|
static |
Tells if the value of the specified property can be set by this Object Accessor.
object | $object | Object containting the property |
string | $propertyName | Name of the property to check |
\InvalidArgumentException |
Definition at line 301 of file ObjectAccess.php.
References elseif.
|
static |
Set a property for a given object. Tries to set the property the following ways:
mixed | &$subject | The target object or array |
string | $propertyName | Name of the property to set |
mixed | $propertyValue | Value of the property |
bool | $forceDirectAccess | directly access property using reflection(!) |
\InvalidArgumentException | in case $object was not an object or $propertyName was not a string |
Definition at line 188 of file ObjectAccess.php.
Referenced by ControllerContext\extend().
const ACCESS_GET = 0 |
Definition at line 29 of file ObjectAccess.php.
const ACCESS_PUBLIC = 2 |
Definition at line 33 of file ObjectAccess.php.
const ACCESS_SET = 1 |
Definition at line 31 of file ObjectAccess.php.