[TYPO3-mvc] fe_users - After Table Mapping custom field still missing
Christian Essl
essl at incert.at
Tue Jul 5 14:17:27 CEST 2011
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_UserRepository');
$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?
More information about the TYPO3-project-typo3v4mvc
mailing list