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-2017 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package WoltLabSuite\Core\Acp\Package\Plugin
14 class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
18 public $className = ObjectTypeDefinitionEditor::class;
23 public $tagName = 'definition';
28 protected function handleDelete(array $items) {
29 $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName."
30 WHERE definitionName = ?
32 $statement = WCF::getDB()->prepareStatement($sql);
33 foreach ($items as $item) {
35 $item['attributes']['name'],
36 $this->installation->getPackageID()
44 protected function prepareImport(array $data) {
46 'interfaceName' => isset($data['elements']['interfacename']) ? $data['elements']['interfacename'] : '',
47 'definitionName' => $data['elements']['name'],
48 'categoryName' => isset($data['elements']['categoryname']) ? $data['elements']['categoryname'] : ''
55 protected function findExistingItem(array $data) {
57 FROM wcf".WCF_N."_".$this->tableName."
58 WHERE definitionName = ?";
59 $parameters = [$data['definitionName']];
63 'parameters' => $parameters