2 namespace wcf\system\package\plugin;
3 use wcf\data\object\type\definition\ObjectTypeDefinitionEditor;
7 * Installs, updates and deletes object type definitions.
9 * @author Alexander Ebert
10 * @copyright 2001-2016 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package com.woltlab.wcf
13 * @subpackage acp.package.plugin
14 * @category Community Framework
16 class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
20 public $className = ObjectTypeDefinitionEditor::class;
25 public $tagName = 'definition';
30 protected function handleDelete(array $items) {
31 $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName."
32 WHERE definitionName = ?
34 $statement = WCF::getDB()->prepareStatement($sql);
35 foreach ($items as $item) {
37 $item['attributes']['name'],
38 $this->installation->getPackageID()
46 protected function prepareImport(array $data) {
48 'interfaceName' => (isset($data['elements']['interfacename']) ? $data['elements']['interfacename'] : ''),
49 'definitionName' => $data['elements']['name'],
50 'categoryName' => (isset($data['elements']['categoryname']) ? $data['elements']['categoryname'] : '')
57 protected function findExistingItem(array $data) {
59 FROM wcf".WCF_N."_".$this->tableName."
60 WHERE definitionName = ?";
61 $parameters = [$data['definitionName']];
65 'parameters' => $parameters