[TYPO3-mvc] MM relation to pages Table

Frank fr_ae_nk at me.com
Mon Mar 7 20:23:37 CET 2011


Hi Franz,

I want to display page related information.
I have three Tables

TableA   1...n   TableB   1...n   pages

An entry in TableA can have a setting defined in TableB depending on 
the site id defined in TableB_pages_mm
An setting can be used by multiple entries defined in TableA.

What functions have to be implemented in the Domain_Model_Pages Object?
Is it necessary to define a mapping?

config.tx_extbase.persistence.classes {
	Tx_Pluginname_Domain_Model_Pages{
		mapping{
			tableName = pages
			recordType = Tx_Pluginname_Domain_Model_Pages
		}
	}
}

Is it correct to define the following methods in the Model_TableA

/**
 * Properties
 *
 * @var 
Tx_Extbase_Persistence_ObjectStorage<Tx_Pluginname_Domain_Model_TableB> 
$entryprops
 */
protected $entryprops;

and then the: add, remove, set, get Method


Do I have to write the same in Model_TableB for the pages object?


Thanks,

Frank



On 2011-03-03 11:05:53 +0100, Franz Koch said:

> Hey Frank,
> 
>> I have a simple relation:
>> 
>> object can be active on multipe pages
> ...
>> Do I have to create a Domain_Model_Pages Object whose columns I also
>> have to map via TypoScript to the already available typo3 database table
>> "pages"?
>> 
>> Or is there a much simpler way to achieve that?
> 
> sorry, I'm haven't understood the exact problem here. How do you have 
> to interact with the pages?
> In order to deal with pages in Extbase (display page related 
> information in the templates and assign them to objects) you'll need a 
> according domain model. But if you only like to fetch a entity stored 
> on a specific page, you don't necessarily need a page model for that - 
> except you like to have a relation to the pages within your entity and 
> display the related pages (e.g. $yourObject->getPages()).
> 
> Could you give some more details on what you try to achieve? Then we 
> can give you a definite answer on what to do.




More information about the TYPO3-project-typo3v4mvc mailing list