-
Notifications
You must be signed in to change notification settings - Fork 1
/
Attribute.php
35 lines (33 loc) · 2.1 KB
/
Attribute.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/*////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\ FME Fieldsmanager extension \\\\\\\\\\\\\\\\\\\\\\\\\
/////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\ NOTICE OF LICENSE\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
/////// ///////
\\\\\\\ This source file is subject to the Open Software License (OSL 3.0)\\\\\\\
/////// that is bundled with this package in the file LICENSE.txt. ///////
\\\\\\\ It is also available through the world-wide-web at this URL: \\\\\\\
/////// http://opensource.org/licenses/osl-3.0.php ///////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
/////// * @category FME ///////
\\\\\\\ * @package FME_Fieldsmanager \\\\\\\
/////// * @author Malik Tahir Mehmood <malik.tahir786@gmail.com> ///////
\\\\\\\ \\\\\\\
/////////////////////////////////////////////////////////////////////////////////
\\* @copyright Copyright 2010 © free-magentoextensions.com All right reserved\\\
/////////////////////////////////////////////////////////////////////////////////
*/
require_once BP.DS.'app'.DS.'code'.DS.'core'.DS.'Mage'.DS.'Catalog'.DS.'Model'.DS.'Entity'.DS.'Attribute.php';
class FME_Fieldsmanager_Model_Entity_Attribute extends Mage_Catalog_Model_Entity_Attribute
{
protected function _beforeSave()
{
if (!Mage::getSingleton('adminhtml/session')->getIsForFME() || Mage::getSingleton('adminhtml/session')->getIsForFME()==false){
if ($this->_getResource()->isUsedBySuperProducts($this)) {
throw Mage::exception('Mage_Eav', Mage::helper('eav')->__('This attribute is used in configurable products'));
}
$this->setData('modulePrefix', self::MODULE_NAME);
return parent::_beforeSave();
}
}
}