1+ <?php
2+ /**
3+ * This file is part of a FireGento e.V. module.
4+ *
5+ * This FireGento e.V. module is free software; you can redistribute it and/or
6+ * modify it under the terms of the GNU General Public License version 3 as
7+ * published by the Free Software Foundation.
8+ *
9+ * This script is distributed in the hope that it will be useful, but WITHOUT
10+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12+ *
13+ * PHP version 5
14+ *
15+ * @category FireGento
16+ * @package FireGento_AdminMonitoring
17+ * @author FireGento Team <team@firegento.com>
18+ * @copyright 2014 FireGento Team (http://www.firegento.com)
19+ * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
20+ */
21+ /**
22+ * Observes Category Move
23+ *
24+ * @category FireGento
25+ * @package FireGento_AdminMonitoring
26+ * @author FireGento Team <team@firegento.com>
27+ */
28+ class FireGento_AdminMonitoring_Model_Observer_Category_Move
29+ extends FireGento_AdminMonitoring_Model_Observer_Log
30+ {
31+
32+ /**
33+ * Observe the category move
34+ *
35+ * @param Varien_Event_Observer $observer Observer Instance
36+ * @return void
37+ */
38+ public function catalogCategoryMove (Varien_Event_Observer $ observer )
39+ {
40+ $ category = $ observer ->getCategory ();
41+
42+ $ dataModel = Mage::getModel ('firegento_adminmonitoring/history_data ' , $ category );
43+ $ diffModel = Mage::getModel ('firegento_adminmonitoring/history_diff ' , $ dataModel );
44+
45+ $ eventData = array (
46+ 'object_id ' => $ dataModel ->getObjectId (),
47+ 'object_type ' => $ dataModel ->getObjectType (),
48+ 'content ' => $ dataModel ->getSerializedContent (),
49+ 'content_diff ' => $ diffModel ->getSerializedDiff (),
50+ 'action ' => FireGento_AdminMonitoring_Helper_Data::ACTION_UPDATE ,
51+ );
52+
53+ Mage::dispatchEvent ('firegento_adminmonitoring_log ' , $ eventData );
54+ }
55+ }
0 commit comments