2 namespace wcf\system\package\plugin;
6 * Installs, updates and deletes object type definitions.
8 * @author Alexander Ebert
9 * @copyright 2001-2012 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\AbstractXMLPackageInstallationPlugin::$tagName
24 public $tagName = 'definition';
27 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete()
29 protected function handleDelete(array $items) {
30 $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName."
31 WHERE definitionName = ?
33 $statement = WCF::getDB()->prepareStatement($sql);
34 foreach ($items as $item) {
35 $statement->execute(array(
36 $item['attributes']['name'],
37 $this->installation->getPackageID()
43 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport()
45 protected function prepareImport(array $data) {
47 'interfaceName' => (isset($data['elements']['interfacename']) ? $data['elements']['interfacename'] : ''),
48 'definitionName' => $data['elements']['name'],
49 'categoryName' => (isset($data['elements']['categoryname']) ? $data['elements']['categoryname'] : '')
54 * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::findExistingItem()
56 protected function findExistingItem(array $data) {
58 FROM wcf".WCF_N."_".$this->tableName."
59 WHERE definitionName = ?";
60 $parameters = array($data['definitionName']);
64 'parameters' => $parameters