Feature #6390

ObjectAccess::getPropertyPath doesn't support Arrays

Added by Marc Neuhaus over 11 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Should have
Category:
Reflection
Start date:
2010-04-16
Due date:
% Done:

100%

Estimated time:
1.00 h
PHP Version:
Has patch:
Complexity:

Description

Would be great to enable the Access of Arrays through the getPropertyPath.

It already used to work with this old implementation of the getProperty function:
static public function getPropertyPath($object, $propertyPath) {
$propertyPathSegments = explode('.', $propertyPath);
foreach ($propertyPathSegments as $pathSegment) {
$object = self::getProperty($object, $pathSegment);
if ($object === NULL) return NULL;
}
return $object;
}

Main Problem seems the isPropertyGettable function because it only checks the Objects getters and doesn't consider all Possibilities supported by the getProperty function.


Files

ObjectAccess.diff (420 Bytes) ObjectAccess.diff Marc Neuhaus, 2010-03-12 15:35

Related issues

Related to TYPO3.Fluid - Feature #7203: Object accessor could work for associative arraysResolved2010-04-10

Actions
#1

Updated by Karsten Dambekalns over 11 years ago

  • Category set to Reflection
#2

Updated by Marc Neuhaus over 11 years ago

Here is a Diff(Based on current trunk) to enable the Access of Arrays through ObjectAccess

#3

Updated by Karsten Dambekalns over 11 years ago

  • Tracker changed from Bug to Feature
#4

Updated by Karsten Dambekalns over 11 years ago

  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
  • Target version set to 1.0 alpha 8
  • Start date changed from 2010-02-07 to 2010-04-16
  • Estimated time set to 1.00 h
#5

Updated by Karsten Dambekalns over 11 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4185.

Also available in: Atom PDF