[Typo3] MM relations

Paul vanweel at cistron.nl
Fri Apr 29 13:34:21 CEST 2005


Hi list

I've been trying to get 2 extensions to communicate with each other. I've got an activities extension in which admins can create activities and I've got an 'person' extension, in which details of people are stored.

Now I want to be able to connect those 2 with an M <-> M relation using a connection table:

CREATE TABLE tx_activities_activities_persons_mm (
  uid_local int(11) unsigned NOT NULL default '0',
  uid_foreign int(11) unsigned NOT NULL default '0',
  tablenames varchar(30) NOT NULL default '',
  sorting int(11) unsigned NOT NULL default '0',
  KEY uid_local (uid_local),
  KEY uid_foreign (uid_foreign)
) TYPE=MyISAM;

Then you'd get in your tca.php of the persons extension:

"activities" => Array (
                "exclude" => 1,
                "label" => "LLL:EXT:persons/locallang_db.php:tx_persons_persons.activities:ESQ",
                "config" => Array (
                "type" => "select",
                "foreign_table" => "tx_activities_activities",
                "foreign_table_where" => "ORDER BY  tx_activities_activities.name",
                "size" => 10,
                "minitems" => 0,
                "maxitems" => 15,
                "MM" => "tx_activities_activities_persons_mm",

Now I can add activities to persons (using the persons extension). However I want to be able to add persons to activities (using the activities extension) as well...

However if I hack this code - and tweak it a little - I can add the persons to the activities, but the local_uid and foreign_uid are substituted.... which is logical...

Is there a way to make this work so I can add persons to activities and add activities to persons?

Thanks in advance,

- Paul (asphyxion)

-----------------------
The mailing list archive is found here:
http://typo3.org/documentation/mailing-lists/english-main-list-archive/
				



More information about the TYPO3-english mailing list