[TYPO3-mvc] bug? extbase doesn't use getter

Jochen Rau jochen.rau at typoplanet.de
Wed Jun 9 13:32:49 CEST 2010


Hi Dmitri.

On 2010-06-09, Dmitri Pisarev <dimaip at gmail.com> wrote:
> I tried to rewrite it like this:
> $arr = array();
>
>          $rc = new ReflectionClass(get_class($object));
>          $properties = $rc->getProperties();
>          foreach ($properties as $property) {
>
>              if (count($columns) > 0 && !in_array($property->name, 
> $columns)) {
>                  // Current property should not be returned
>                  continue;
>              }
>              $arr[$property->name] = 
> Tx_Extbase_Reflection_ObjectAccess::getProperty($object, $property->name);
>          }
>          return $arr;
>
> But it throws a #1263391473: The property "_localizedUid" on the subject 
> was not accessible.
>
> Shall I try to catch it and just skip it?

Don't use the ReflectionClass of PHP but use Tx_Extbase_Reflection_ObjectAccess->getAccessibleProperties(). Keep in mind, that this is no official API and the method name might change in future.

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list