You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
1003 B

<?php
// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
/**
* @param $installer
*/
function pre_20100623_semantic_to_relation_tiki($installer)
{
$results = $installer->fetchAll('SELECT * FROM tiki_links WHERE reltype IS NOT NULL');
foreach ($results as $row) {
$reltypes = array_filter(explode(',', $row['reltype']));
foreach ($reltypes as $type) {
$installer->query(
'INSERT INTO tiki_object_relations (relation, source_type, source_itemId, target_type, target_itemId) VALUES(?, ?, ?, ?, ?)',
[
'tiki.link.' . $type,
'wiki page',
$row['fromPage'],
'wiki page',
$row['toPage'],
]
);
}
}
}