2 namespace wcf\system\package\plugin;
6 * This PIP installs, updates or deletes user notification types.
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.notification
12 * @subpackage system.package.plugin
13 * @category Community Framework
15 class UserNotificationTypePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
17 * @see AbstractXMLPackageInstallationPlugin::$className
19 public $className = 'wcf\data\user\notification\type\UserNotificationTypeEditor';
22 * @see AbstractXMLPackageInstallationPlugin::$tableName
24 public $tableName = 'user_notification_type';
27 * @see AbstractXMLPackageInstallationPlugin::$tagName
29 public $tagName = 'notificationtype';
32 * @see AbstractXMLPackageInstallationPlugin::handleDelete()
34 protected function handleDelete(array $items) {
35 $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName."
37 AND notificationType = ?";
38 $statement = WCF::getDB()->prepareStatement($sql);
39 foreach ($items as $item) {
40 $statement->execute(array(
41 $this->installation->getPackageID(),
42 $item['elements']['name']
48 * @see AbstractXMLPackageInstallationPlugin::prepareImport()
50 protected function prepareImport(array $data) {
52 'notificationType' => $data['elements']['name'],
53 'className' => $data['elements']['classname'],
54 'permissions' => (isset($data['elements']['permissions']) ? $data['elements']['permissions'] : ''),
55 'options' => (isset($data['elements']['options']) ? $data['elements']['options'] : '')
60 * @see AbstractXMLPackageInstallationPlugin::findExistingItem()
62 protected function findExistingItem(array $data) {
64 FROM wcf".WCF_N."_".$this->tableName."
66 AND notificationType = ?";
68 $this->installation->getPackageID(),
69 $data['notificationType']
74 'parameters' => $parameters