public function __construct($itemType = null) { EventHandler::getInstance()->fireAction($this, 'init'); if (!$itemType instanceof \wcf\data\jcoins\shop\item\type\JCoinsShopItemType) { $this->itemType = \wcf\data\jcoins\shop\item\type\JCoinsShopItemType::getByIdentifer($this->getIdentifer()); } else { $this->itemType = $itemType; } EventHandler::getInstance()->fireAction($this, 'inited'); }
/** * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::validateImport() */ protected function validateImport(array $data) { if (empty($data['className'])) { throw new SystemException('className cannot be empty'); } if (empty($data['identifer'])) { throw new SystemException('identifer cannot be empty'); } else { $type = JCoinsShopItemType::getByIdentifer($data['identifer']); if ($type->getObjectID() != 0) { $package = new \wcf\data\package\Package($type->packageID); throw new SystemException('identifer is not unique (use by: ' . $package->packageName . ')'); } } }