[TYPO3-dev] Accessing MM relations "from both sides"?

Mario Rimann typo3-coding at rimann.org
Thu Aug 17 11:34:05 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all

I have an extension that holds group (team) and person (teammember)
records. Until now, it was just possible to assign groups to a person
record via an MM-table.

Then I worked with that extension for the first time with *many*
persons, and found it would be much more comfortable to have the
possibility to assign persons to group records (using the same MM-table
- - but vice-versa).

For that I added a new field to the group record and the according TCA
definition. That's what happens if I add the same person (uid=2) to the
same group (uid=3) - once via the person's record and once via the group
record:

mysql> SELECT *
    -> FROM `tx_bzdstaffdirectory_persons_usergroups_mm` ;
+-----------+-------------+------------+---------+
| uid_local | uid_foreign | tablenames | sorting |
+-----------+-------------+------------+---------+
|         2 |           3 |            |       1 |
|         3 |           2 |            |       1 |
+-----------+-------------+------------+---------+
2 rows in set (0.00 sec)

It's just inverted - that's the problem. First I tried it with the
person with uid=3 - of course it worked. That's all.

My search brought up an older post (that is not answered yet):
http://lists.netfielders.de/pipermail/typo3-english/2005-January/000007.html

Is there a solution? Something like a "invertForeignAndLocalTable"
switch for the TCA definition of the groups table?

Cheers,
Mario
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE5DgM5yAXgAWej3wRAtYhAJ0ffjygCglQktA9SaZXTo4P/f6OMQCfbbTb
Tp1XqH5hKO0XPnyI6k8EtdM=
=MVqp
-----END PGP SIGNATURE-----




More information about the TYPO3-dev mailing list