Author: jablko
Date: Fri Sep 4 17:10:22 2009
New Revision: 3175
Log:
Migrate language and script properties
Modified:
trunk/lib/task/migrate/QubitMigrate107to108.class.php
Modified: trunk/lib/task/migrate/QubitMigrate107to108.class.php
==============================================================================
--- trunk/lib/task/migrate/QubitMigrate107to108.class.php Fri Sep 4
16:01:30 2009 (r3174)
+++ trunk/lib/task/migrate/QubitMigrate107to108.class.php Fri Sep 4
17:10:22 2009 (r3175)
@@ -45,6 +45,7 @@
// Alter qubit classes (methods ordered alphabetically)
$this->alterQubitMenus();
+ $this->alterQubitPropteries();
$this->alterQubitSettings();
$this->alterQubitStaticPages();
@@ -272,6 +273,64 @@
}
/**
+ * Alter QubitProperty data
+ *
+ * @return QubitMigrate107to108 this object
+ */
+ protected function alterQubitPropteries()
+ {
+ $tmp = array();
+ foreach ($this->data['QubitProperty'] as $key => $value)
+ {
+ switch ($value['name'])
+ {
+ case 'information_object_language':
+ case 'information_object_script':
+ case 'language_of_information_object_description':
+ case 'script_of_information_object_description':
+ $tmp[$value['object_id']][$value['name']][] =
$value['value'][$value['source_culture']];
+
+ unset($this->data['QubitProperty'][$key]);
+ }
+ }
+
+ foreach ($tmp as $id => $value)
+ {
+ foreach ($value as $name => $value)
+ {
+ $key = rand();
+ $this->data['QubitProperty'][$key] = array();
+ $this->data['QubitProperty'][$key]['object_id'] = $id;
+
+ switch ($name)
+ {
+ case 'information_object_language':
+ $this->data['QubitProperty'][$key]['name'] = 'language';
+
+ break;
+
+ case 'information_object_script':
+ $this->data['QubitProperty'][$key]['name'] = 'script';
+
+ break;
+
+ case 'language_of_information_object_description':
+ $this->data['QubitProperty'][$key]['name'] =
'languageOfDescription';
+
+ break;
+
+ case 'script_of_information_object_description':
+ $this->data['QubitProperty'][$key]['name'] = 'scriptOfDescription';
+
+ break;
+ }
+
+ $this->data['QubitProperty'][$key]['value'] = serialize($value);
+ }
+ }
+ }
+
+ /**
* Alter QubitSetting data
*
* @return QubitMigrate107to108 this object
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---