2 namespace wcf\system\package\plugin;
6 * This PIP installs, updates or deletes object type definitions.
8 * @author Alexander Ebert
9 * @copyright 2001-2011 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package com.woltlab.wcf
12 * @subpackage acp.package.plugin
13 * @category Community Framework
15 class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
17 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$className
19 public $className = 'wcf\data\object\type\definition\ObjectTypeDefinitionEditor';
22 * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
24 public $tableName = 'object_type_definition';
27 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
29 public $tagName = 'definition';
32 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete()
34 protected function handleDelete(array $items) {
35 $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName."
36 WHERE definitionName = ?
38 $statement = WCF::getDB()->prepareStatement($sql);
39 foreach ($items as $item) {
40 $statement->execute(array(
41 $item['attributes']['name'],
42 $this->installation->getPackageID()
48 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport()
50 protected function prepareImport(array $data) {
52 'interfaceName' => (isset($data['elements']['interfacename']) ? $data['elements']['interfacename'] : ''),
53 'definitionName' => $data['elements']['name'],
54 'categoryName' => (isset($data['elements']['categoryname']) ? $data['elements']['categoryname'] : '')
59 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::findExistingItem()
61 protected function findExistingItem(array $data) {
63 FROM wcf".WCF_N."_".$this->tableName."
64 WHERE definitionName = ?
67 $data['definitionName'],
68 $this->installation->getPackageID()
73 'parameters' => $parameters