// get object type cache
$this->objectTypes = ObjectTypeCacheBuilder::getInstance()->getData(array(), 'objectTypes');
- foreach ($this->objectTypes as $objectType) {
- $definition = $this->getDefinition($objectType->definitionID);
- if (!isset($this->groupedObjectTypes[$definition->definitionName])) {
- $this->groupedObjectTypes[$definition->definitionName] = array();
- }
-
- $this->groupedObjectTypes[$definition->definitionName][$objectType->objectType] = $objectType;
- }
+ $this->groupedObjectTypes = ObjectTypeCacheBuilder::getInstance()->getData(array(), 'groupedObjectTypes');
}
/**
$data = array(
'categories' => array(),
'definitions' => array(),
- 'objectTypes' => array()
+ 'objectTypes' => array(),
+ 'groupedObjectTypes' => array()
);
// get definitions
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
while ($row = $statement->fetchArray()) {
- $data['objectTypes'][$row['objectTypeID']] = new ObjectType(null, $row);
+ $data['objectTypes'][$row['objectTypeID']] = $objectType = new ObjectType(null, $row);
+
+ $definition = $data['definitions'][$objectType->definitionID];
+ if (!isset($data['groupedObjectTypes'][$definition->definitionName])) $data['groupedObjectTypes'][$definition->definitionName] = array();
+ $data['groupedObjectTypes'][$definition->definitionName][$objectType->objectType] = $objectType;
}
return $data;