[TYPO3-mvc] FrontendUser Model - ExtBase 1.0.2 & 1.2.0Beta2

Nils Blattner nb at cabag.ch
Mon May 31 13:29:16 CEST 2010


Hi Christian

 From how I see it your Model has the PHDoc for the getter wrong.
Try it with @return Tx_Extbase_Domain_Model_FrontendUser.

Some additional configuration in your TS might be needed, but i think 
that should work.

Regards
Nils

Am 31.05.10 12:23, schrieb Christian Schwan:
> Hey guys, i got a problem with extBase 1.0.2 or 1.2.0 Beta2
> I tried to get the “username” from FE_Users with the uid from my own table.
>
> Controller ->  Dashboard
>
> $this->view->assign('history',
> $this->historyRepository->findByFeUserHistory($this->vars['page'],
> $itemsPerPage, $pageCount));
>
> Template ->  Dashboard ->  Index
>
> <f:for each="{history}" as="value">
> {value.feUserId.username}
> </f:for>
>
> Domain ->  Model ->  History
>
> /**
> * @var Tx_Extbase_Domain_Model_FrontendUser
> */
>
> protected $feUserId;
>
> /**
>   * Getter for Action
>   * @return string
>   */
> public function getFeUserId() {
> return $this->feUserId;
> }
>
> TCA
>
> 'fe_user_id' =>  array(
> 'exclude' =>  1,
> 'label'   =>  'LLL:EXT:crm/Resources/Private/Language/locallang_db.xml:tx_crm_domain_model_history.user',
> 'config' =>  array(
>          'type' =>  'select',
>          'items' =>  array(
>             array('', 0),
>           ),
>          'foreign_class' =>  'Tx_Extbase_Domain_Model_FrontendUser',
>          'foreign_table' =>  'fe_users',
>          'foreign_table_where' =>  'ORDER BY fe_users.name',
>          'size' =>  1,
>          'minitems' =>  1,
>          'maxitems' =>  1,
>         ),
> ),
>
>
> On ExtBase 1.0.2 in Xampp I got the following error:
>
> #1237301367: $object must be an object or an array, boolean given.
>
> 45 Tx_Extbase_Reflection_ObjectAccess::getProperty(boolean, "username")
> 44 Tx_Extbase_Reflection_ObjectAccess::getPropertyPath(Tx_Crm_Domain_Model_History,
> "feUserId.username")
>
> On ExtBase 1.0.2 Linux
>
> No Error
>
> On ExtBase 1.2.0 Beta2 on both Systems
>
> Is not working
>
> Does anyone know what I’m doing wrong?



More information about the TYPO3-project-typo3v4mvc mailing list