[TYPO3-mvc] Using a foreign model which uses an existing table (tx_dam) needs persistance-typoscript twice

Marco Huber Marco.Huber at marit.ag
Wed Apr 21 17:00:24 CEST 2010


Hi list,

I use an extension (let's call it A) which implements a model
(A_Domain_Model_Dam) for the tx_dam-table. So it's clear that the
Typoscript of A must have the mapping rules in the persistence-section.

plugin.A.persistence.classes.A_Domain_Model_Dam.mapping.tableName =
tx_dam

Now I've got a second extension (let's call it B ;-)) which has a Model
(B_Domain_Model_Project) with a field images. In the model class I have
configured the field to store DAM-images:

class B_Domain_Model_Project extends
Tx_Extbase_DomainObject_AbstractEntity {
/**
 * images
 * @var Tx_Extbase_Persistence_ObjectStorage<A_Domain_Model_Dam>
 */
protected $images;
/**
 * Setter for images
 *
 * @param Tx_Extbase_Persistence_ObjectStorage<A_Domain_Model_Dam>
$images images
 * @return void
 */
public function setImages(Tx_Extbase_Persistence_ObjectStorage $images)
{
	$this->images = $images;
}
/**
 * Getter for images
 *
 * @return Tx_Extbase_Persistence_ObjectStorage<A_Domain_Model_Dam>
images
 */
public function getImages() {
	return $this->images;
}
}

But to make this work I have to write the same mapping rules to the
Typoscript of B like I already did in A (or at least something like
plugin.B.persistence.classes.B_Domain_Model_Dam <
plugin.A.persistence.classes.A_Domain_Model_Dam).

Can anybody give me a hint why I have to write the Typoscript twice?

Kind regards,
Marco


More information about the TYPO3-project-typo3v4mvc mailing list