From: Marcel Werk Date: Sun, 7 Jul 2013 15:21:42 +0000 (+0200) Subject: Added like importer X-Git-Tag: 2.0.0_Beta_5~90^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a18a3af61fa7ccb61aa421da2d9d3990c6a37e89;p=GitHub%2FWoltLab%2FWCF.git Added like importer --- diff --git a/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php new file mode 100644 index 0000000000..14d24c58a5 --- /dev/null +++ b/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php @@ -0,0 +1,34 @@ + + * @package com.woltlab.wcf + * @subpackage system.importer + * @category Community Framework + */ +class AbstractLikeImporter implements IImporter { + /** + * object type id for likes + * @var integer + */ + protected $objectTypeID = 0; + + /** + * @see wcf\system\importer\IImporter::import() + */ + public function import($oldID, array $data) { + if ($data['objectUserID']) $data['objectUserID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['objectUserID']); + $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); + if (!$data['userID']) return 0; + + $like = LikeEditor::create(array_merge($data, array('objectTypeID' => $this->objectTypeID))); + + return $like->likeID; + } +}