[TYPO3-mvc] fe_users - After Table Mapping custom field still missing

Mattias Nilsson mattias at pixelant.se
Tue Jul 5 14:20:35 CEST 2011


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_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?
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>



-- 
Mvh
/Mattias


More information about the TYPO3-project-typo3v4mvc mailing list