문제

What is the equivalent Magento 1 :

$tmp = new Mage_Catalog_Model_Resource_Eav_Attribute();

in Magento 2?

도움이 되었습니까?

해결책

\Magento\Catalog\Model\ResourceModel\Eav\Attribute this class is equivalent to Magento2

use Magento\Catalog\Model\ResourceModel\Eav\Attribute;

/**
 * @var attribute
 */
protected $attribute;


/**     
 * @param attribute $attribute     
 */
public function __construct(        
    Attribute $attribute,        
) {

    $this->$attribute = $attribute;

}

Now you can use this like,

$this->$attribute->isAllowedForRuleCondition() // it depends on your need which method you want use

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top