[TYPO3-mvc] bug? extbase doesn't use getter
Dmitri Pisarev
dimaip at gmail.com
Tue Jun 8 12:15:58 CEST 2010
On 08.06.2010 13:17, Bastian Waidelich wrote:
> Dmitri Pisarev wrote:
>
> Hi Dmitri,
>
>> extbase doesn't seem to use getter, but rather
>> uses the raw value. Why is that?
>
> Extbase should use Tx_Extbase_Reflection_ObjectAccess::getProperty() to
> retrieve the value of a field.
> If following is true, it should work:
>
> 1. is_array($yourObject) returns FALSE
> 2. is_callable(array($yourObject), 'getDatetime')) returns TRUE
>
> Maybe a typo?
>
> Best,
> Bastian
>
>
Hi Bastian!
Here is my controller code:
$articles =
$this->articleRepository->findByCategory($category,$start,$limit,$sort,$dir);
foreach($articles as $article){
var_dump(is_array($article)); //FALSE
var_dump(is_callable(array($article), 'getDatetime')); //FALSE
var_dump($article->getDatetime()); //1234567 (The correct
result)
}
Why does it happen?
Regards,
Dmitri.
More information about the TYPO3-project-typo3v4mvc
mailing list