From a18a3af61fa7ccb61aa421da2d9d3990c6a37e89 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sun, 7 Jul 2013 17:21:42 +0200 Subject: [PATCH] Added like importer --- .../importer/AbstractLikeImporter.class.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php 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; + } +} -- 2.20.1