[TYPO3-mvc] Using Tx_Extbase_Domain_Model_FrontendUser as property
Michael Knoll
mimi at kaktusteam.de
Tue Jan 18 20:51:17 CET 2011
Hi there,
I tried to use the extbase frontend user model as a property on a domain
object. What I did therefore was creating an domain object which is
called "Tx_Rbac_Domain_Model_User" and gave it the following TCA
(fe-user field only):
'fe_user' => array(
'exclude' => 0,
'label' => fe_user',
'config' => array(
'type' => 'select',
'foreign_table' => 'fe_users',
'foreign_class' => 'Tx_Extbase_Domain_Model_FrontendUser',
'minitems' => 0,
'maxitems' => 1,
'appearance' => array(
'collapse' => 0,
'newRecordLinkPosition' => 'bottom',
),
)
),
the corresponding ext_tables.sql entry looks like that:
CREATE TABLE tx_rbac_domain_model_user (
...
fe_user int(11) unsigned DEFAULT '0' NOT NULL,
...
);
and finally, here's the code inside Tx_Rbac_Domain_Model_User class:
class Tx_Rbac_Domain_Model_User extends
Tx_Extbase_DomainObject_AbstractEntity {
/**
* Holds a frontend user instance
*
* @var Tx_Extbase_Domain_Model_FrontendUser
*/
protected $feUser;
/**
* @return Tx_Extbase_Domain_Model_FrontendUser
*/
public function getFeUser() {
return $this->feUser;
}
/**
* @param Tx_Extbase_Domain_Model_FrontendUser $feUser
*/
public function setFeUser(Tx_Extbase_Domain_Model_FrontendUser $feUser) {
$this->feUser = $feUser;
}
// ...
}
Somehow my feUser object is not loaded when the rest of the user object
is loaded. What am I doing wrong here.
P.S. For some reason, I do not want to extend feUser object for this, so
please do not tell me to do so :-)
Thanks for your help!
Greetings
Mimi
More information about the TYPO3-project-typo3v4mvc
mailing list