[TYPO3-mvc] fe_users - After Table Mapping custom field still missing
Christian Essl
essl at incert.at
Tue Jul 5 14:25:49 CEST 2011
Thanks, now I got it. :)
-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Mattias Nilsson
Gesendet: Dienstag, 05. Juli 2011 14:21
An: TYPO3 v4 MVC project
Betreff: Re: [TYPO3-mvc] fe_users - After Table Mapping custom field still missing
You should do this to yout typoscript setup:
Typoscript-Setup:
config.tx_extbase.persistence.
classes {
Tx_MyExtension_Domain_Model_User {
mapping {
tableName = fe_users
*yourDatabaseColumnName = test*
}
}
}
On Tue, Jul 5, 2011 at 2:17 PM, Christian Essl <essl at incert.at> wrote:
> Hi,
>
> I extended my fe_users table with a new integer field and set
> everything up in my extbase extension to map the table accordingly:
>
> User-Model:
> <?php
> class Tx_MyExtension_Domain_Model_User extends
> Tx_Extbase_Domain_Model_FrontendUser
> {
> /**
> * @var int
> */
> protected $test;
>
> public function setTest($test)
> {
> $this->test = $test;
> }
> public function getTest()
> {
> return $this->test;
> }
> }
> ?>
>
> ----------------------------
>
> Controller:
> $this->userRepository =
> t3lib_div::makeInstance('Tx_MyExtension_Domain_Repository_UserReposito
> ry');
> $this->view->assign('user',
> $this->userRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid'
> ]));
>
> ------------------------------
>
> Typoscript-Setup:
> config.tx_extbase.persistence.classes {
> Tx_MyExtension_Domain_Model_User {
> mapping {
> tableName = fe_users
> }
> }
> }
>
> ----------------------------------
>
> The table is correctly mapped, as it would throw an exception, if I
> removed the typoscript setup.
>
> But when I try to output the new table field with {user.test} in my
> view, nothing is shown. Every other default field like {user.uid} or
> {user.username} is outputted correctly; only my custom field is
> missing. :(
>
> I put the user-object in var dump, where my test-field only shows NULL:
> ["test:protected"]=> NULL
>
> Am I missing something?
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4m
> vc
>
--
Mvh
/Mattias
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list