Hi all,
The Item Association in Joomla 3.0.2 is awesome!
The description at
http://community.joomla.org/blogs/community/1695-multilanguage-in-302-whats-new.html
is extensive.
However, I can't find technical information about how the
#__associations + "key" field work.
E.g. I have 3 content items:
INSERT INTO `jos_content` VALUES(1, 37, 'testing', 'testing', '<p>one
two three</p>', '', 1, 8, '2012-12-10 06:58:24', 856, [..] 1, 'en-GB',
'');
INSERT INTO `jos_content` VALUES(2, 38, 'testen', 'testen', '<p>een
twee drie</p>', '', 1, 9, '2012-12-10 06:58:43', 856, [..] 1, 'nl-NL',
'');
INSERT INTO `jos_content` VALUES(6, 43, 'Test', 'test', '<p>un deux
trois</p>', '', 1, 10, '2012-12-10 15:55:43', 856, [..] 0, 'fr-FR',
'');
associated with each other, and the #__associations now contains:
id, context, key
1, com_content.item, 299772356e624c6858d75ddc57a06f0e
2, com_content.item, 299772356e624c6858d75ddc57a06f0e
6, com_content.item, 299772356e624c6858d75ddc57a06f0e
I noticed that the "key" field is created upon saving via /
administrator/components/com_content/models/article.php
Between line 441 - 498 it says:
if (!$all_language && count($associations)) {
// Adding new association for these items
$key = md5(json_encode($associations));
$query->clear();
$query->insert('#__associations');
foreach ($associations as $tag => $id) {
$query->values($id.','.$db-
>quote('com_content.item') . ',' . $db->quote($key));
}
$db->setQuery($query);
$db->execute();
My Questions:
1. Can anyone point me to some technical documentation about Item
Association?
2. How does the concept of Item Association work with the "key"
fields?
3. Why are the associations stored as MD5?
4. What SQL statement could you use to create associations directly in
the database using phpMyAdmin?
Thanks in advance!
Peter Martin