[TYPO3-mvc] Record Relation to tt_content
Pankaj Lele
pankaj at lelesys.com
Wed Jul 27 18:03:13 CEST 2011
Hi!
> I'm doing my first extbase project.
Welcome :)
Few things to check as I described below.
> Classes/Domain/Model/Project.php:
Make sure you have required functions setup like:
/**
* Constructor
*
* @return void
*/
public function __construct() {
// Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}
/**
* Initializes all Tx_Extbase_Persistence_ObjectStorage instances.
*
* @return void
*/
protected function initStorageObjects() {
/**
* Do not modify this method!
* It will be rewritten on each save in the extension builder
* You may modify the constructor of this class instead
*/
$this->content = new Tx_Extbase_Persistence_ObjectStorage();
}
> Typoscript:
>
> plugin.tx_nhb {
> persistence {
> classes {
> Tx_Nhb_Domain_Model_Content {
> mapping {
> tableName = tt_content
> recordType = Tx_Nhb_Domain_Model_Content
> columns {
> }
> }
> }
> }
> }
> }
>
If you are setting the recordType in above TS then you must have a field
defined by $TCA['tt_content']['ctrl']['type'] in tt_content which in
your case is already present "CType".
So you just need to set the value of this field (tt_content.CType) to
'Tx_Nhb_Domain_Model_Content' and then hopefully it should work OR
remove the recordType setting from above TS ;)
Hope it helps
-Pankaj
--
With best regards,
Pankaj Lele
---------------------------
CTO & Executive Director
Lelesys Infotech Pvt. Ltd.
Pune/Goa, India
Web: http://www.lelesys.com
[Certified TYPO3 Integrator]
More information about the TYPO3-project-typo3v4mvc
mailing list