Magento 2 : Invalid method MagentoEavModelEntityAttribute::isScopeStoreI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Not able to add/update magento2 category post upgrade from 1.9 to 2.1.0How to override webapi.xml in custom module?Add configure product in Cart using Magento 2 API facing an issueMagento 2 Front controller reached 100 router match iterations issueMagento2 REST API get all customers detailsDeleted ShipperHQ module causing error in “All Customers” section of Magento 2Unable to Serialize Value Magento 2.2.6“Area code is not set” in var/logwhen click on place order then paypal showing error in Magento2

Light propagating through a sound wave

Asserting that Atheism and Theism are both faith based positions

Deletion of copy-ctor & copy-assignment - public, private or protected?

What are substitutions for coconut in curry?

What does "^L" mean in C?

A Ri-diddley-iley Riddle

Can other pieces capture a threatening piece and prevent a checkmate?

Should I be concerned about student access to a test bank?

In Aliens, how many people were on LV-426 before the Marines arrived​?

Is it possible to stack the damage done by the Absorb Elements spell?

What favor did Moody owe Dumbledore?

What (if any) is the reason to buy in small local stores?

Suggestions on how to spend Shaabath (constructively) alone

Loading the leaflet Map in Lightning Web Component

How to get the n-th line after a grepped one?

What is the relationship between relativity and the Doppler effect?

Can you move over difficult terrain with only 5 feet of movement?

Pronounciation of the combination "st" in spanish accents

How do hiring committees for research positions view getting "scooped"?

What does Deadpool mean by "left the house in that shirt"?

Geography in 3D perspective

In what cases must I use 了 and in what cases not?

Are dual Irish/British citizens bound by the 90/180 day rule when travelling in the EU after Brexit?

Hausdorff dimension of the boundary of fibres of Lipschitz maps



Magento 2 : Invalid method MagentoEavModelEntityAttribute::isScopeStore


I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Not able to add/update magento2 category post upgrade from 1.9 to 2.1.0How to override webapi.xml in custom module?Add configure product in Cart using Magento 2 API facing an issueMagento 2 Front controller reached 100 router match iterations issueMagento2 REST API get all customers detailsDeleted ShipperHQ module causing error in “All Customers” section of Magento 2Unable to Serialize Value Magento 2.2.6“Area code is not set” in var/logwhen click on place order then paypal showing error in Magento2













1















I am getting an issue on Magento 2.2.6 when trying to save my module record. This error occurs sometimes and the error disappears if run Magento upgrade command. But it comes again sometime.



system.log :



[2019-03-18 04:46:32] main.CRITICAL: Exception message: Invalid method MagentoEavModelEntityAttribute::isScopeStore
Trace: #0 /var/www/html/test/app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php(147): MagentoFrameworkDataObject->__call('isScopeStore', Array)
#1 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1536): VendorNameModuleNameModelResourceModelEntityName->_saveAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
#2 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1496): MagentoEavModelEntityAbstractEntity->_insertAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
#3 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1227): MagentoEavModelEntityAbstractEntity->_processSaveData(Array)
#4 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1198): MagentoEavModelEntityAbstractEntity->processSave(Object(VendorNameModuleNameModelEntityName))
#5 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoEavModelEntityAbstractEntity->save(Object(VendorNameModuleNameModelEntityName))
#6 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callParent('save', Array)
#7 /var/www/html/test/vendor/magento/framework/App/Cache/FlushCacheByTags.php(68): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
#8 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoFrameworkAppCacheFlushCacheByTags->aroundSave(Object(VendorNameModuleNameModelResourceModelEntityNameInterceptor), Object(Closure), Object(VendorNameModuleNameModelEntityName))
#9 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
#10 /var/www/html/test/generated/code/VendorName/ModuleName/Model/ResourceModel/EntityName/Interceptor.php(468): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callPlugins('save', Array, NULL)
#11 /var/www/html/test/vendor/magento/framework/Model/AbstractModel.php(647): VendorNameModuleNameModelResourceModelEntityNameInterceptor->save(Object(VendorNameModuleNameModelEntityName))
#12 /var/www/html/test/app/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save.php(86): MagentoFrameworkModelAbstractModel->save()
#13 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(24): VendorNameModuleNameControllerAdminhtmlEntityNameSave->execute()
#14 /var/www/html/test/vendor/magento/framework/App/Action/Action.php(107): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->execute()
#15 /var/www/html/test/vendor/magento/module-backend/App/AbstractAction.php(235): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
#16 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoBackendAppAbstractAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
#17 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callParent('dispatch', Array)
#18 /var/www/html/test/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#19 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoBackendAppActionPluginAuthentication->aroundDispatch(Object(VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#20 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#21 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(39): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callPlugins('dispatch', Array, NULL)
#22 /var/www/html/test/vendor/magento/framework/App/FrontController.php(55): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#23 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
#24 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
#25 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#26 /var/www/html/test/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
#27 /var/www/html/test/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#28 /var/www/html/test/generated/code/Magento/Framework/App/Http/Interceptor.php(24): MagentoFrameworkAppHttp->launch()
#29 /var/www/html/test/vendor/magento/framework/App/Bootstrap.php(257): MagentoFrameworkAppHttpInterceptor->launch()
#30 /var/www/html/test/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))
#31 main [] []
[2019-03-18 04:47:03] main.CRITICAL: Exception message: Invalid method MagentoEavModelEntityAttribute::isScopeStore
Trace: #0 /var/www/html/test/app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php(147): MagentoFrameworkDataObject->__call('isScopeStore', Array)
#1 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1536): VendorNameModuleNameModelResourceModelEntityName->_saveAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
#2 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1496): MagentoEavModelEntityAbstractEntity->_insertAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
#3 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1227): MagentoEavModelEntityAbstractEntity->_processSaveData(Array)
#4 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1198): MagentoEavModelEntityAbstractEntity->processSave(Object(VendorNameModuleNameModelEntityName))
#5 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoEavModelEntityAbstractEntity->save(Object(VendorNameModuleNameModelEntityName))
#6 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callParent('save', Array)
#7 /var/www/html/test/vendor/magento/framework/App/Cache/FlushCacheByTags.php(68): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
#8 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoFrameworkAppCacheFlushCacheByTags->aroundSave(Object(VendorNameModuleNameModelResourceModelEntityNameInterceptor), Object(Closure), Object(VendorNameModuleNameModelEntityName))
#9 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
#10 /var/www/html/test/generated/code/VendorName/ModuleName/Model/ResourceModel/EntityName/Interceptor.php(468): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callPlugins('save', Array, NULL)
#11 /var/www/html/test/vendor/magento/framework/Model/AbstractModel.php(647): VendorNameModuleNameModelResourceModelEntityNameInterceptor->save(Object(VendorNameModuleNameModelEntityName))
#12 /var/www/html/test/app/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save.php(86): MagentoFrameworkModelAbstractModel->save()
#13 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(24): VendorNameModuleNameControllerAdminhtmlEntityNameSave->execute()
#14 /var/www/html/test/vendor/magento/framework/App/Action/Action.php(107): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->execute()
#15 /var/www/html/test/vendor/magento/module-backend/App/AbstractAction.php(235): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
#16 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoBackendAppAbstractAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
#17 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callParent('dispatch', Array)
#18 /var/www/html/test/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#19 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoBackendAppActionPluginAuthentication->aroundDispatch(Object(VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
#20 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#21 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(39): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callPlugins('dispatch', Array, NULL)
#22 /var/www/html/test/vendor/magento/framework/App/FrontController.php(55): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#23 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
#24 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
#25 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
#26 /var/www/html/test/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
#27 /var/www/html/test/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
#28 /var/www/html/test/generated/code/Magento/Framework/App/Http/Interceptor.php(24): MagentoFrameworkAppHttp->launch()
#29 /var/www/html/test/vendor/magento/framework/App/Bootstrap.php(257): MagentoFrameworkAppHttpInterceptor->launch()
#30 /var/www/html/test/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))
#31 main [] []



/app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php




<?php

/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace VendorNameModuleNameModelResourceModel;

use MagentoEavModelEntityAbstractEntity;
use MagentoEavModelEntityContext;
use MagentoFrameworkDataObject;
use MagentoStoreModelStore;
use MagentoStoreModelStoreManagerInterface;
use VendorNameModuleNameSetupEntitySetup;

class EntityName extends AbstractEntity
/**
* Store id
*
* @var int
*/
protected $_storeId = null;

/**
* @var StoreManagerInterface
*/
protected $_storeManager;

/**
* @var EntityManager
*/
protected $entityManager;

/**
* [__construct description]
* @param Context $context [description]
* @param StoreManagerInterface $storeManager [description]
* @param array $data [description]
*/
public function __construct(
Context $context,
StoreManagerInterface $storeManager,
array $data = []
)
parent::__construct($context, $data);
$this->setType(EntitySetup::ENTITY_TYPE_CODE);
$this->setConnection(EntitySetup::ENTITY_TYPE_CODE . '_read', EntitySetup::ENTITY_TYPE_CODE . '_write');
$this->_storeManager = $storeManager;


/**
* Set attribute set id and entity type id value
*
* @param MagentoFrameworkDataObject $customer
* @return $this
* @throws MagentoFrameworkExceptionLocalizedException
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
protected function _beforeSave(MagentoFrameworkDataObject $object)
$object->setAttributeSetId($object->getAttributeSetId() ?: $this->getEntityType()->getDefaultAttributeSetId());
$object->setEntityTypeId($object->getEntityTypeId() ?: $this->getEntityType()->getEntityTypeId());
return parent::_beforeSave($object);


/**
* Return Entity Type instance
*
* @return MagentoEavModelEntityType
*/
public function getEntityType()
if (empty($this->_type))
$this->setType(EntitySetup::ENTITY_TYPE_CODE);

return parent::getEntityType();


/**
* Retrieve ProductFaqNew entity default attributes
*
* @return string[]
*/
protected function _getDefaultAttributes()
return [
'attribute_set_id',
'entity_type_id',
'created_at',
'updated_at',
];


/**
* Set store Id
*
* @param integer $storeId
* @return $this
*/
public function setStoreId($storeId)
$this->_storeId = $storeId;
return $this;


/**
* Return store id
*
* @return integer
*/
public function getStoreId()
if ($this->_storeId === null)
return $this->_storeManager->getStore()->getId();

return $this->_storeId;


/**
* Set Attribute values to be saved
*
* @param MagentoFrameworkModelAbstractModel $object
* @param MagentoEavModelEntityAttributeAbstractAttribute $attribute
* @param mixed $value
* @return $this
*/
protected function _saveAttribute($object, $attribute, $value) $this->getEntityTable() == MagentoEavModelEntity::DEFAULT_ENTITY_TABLE)
$data['entity_type_id'] = $object->getEntityTypeId();


if ($attribute->isScopeStore())
/**
* Update attribute value for store
*/
$this->_attributeValuesToSave[$table][] = $data;
elseif ($attribute->isScopeWebsite() && $storeId != Store::DEFAULT_STORE_ID)
/**
* Update attribute value for website
*/
$storeIds = $this->_storeManager->getStore($storeId)->getWebsite()->getStoreIds(true);
foreach ($storeIds as $storeId)
$data['store_id'] = (int) $storeId;
$this->_attributeValuesToSave[$table][] = $data;

else
/**
* Update global attribute value
*/
$data['store_id'] = Store::DEFAULT_STORE_ID;
$this->_attributeValuesToSave[$table][] = $data;


return $this;




what should I need to change?



Any help would be appriciated.



Thanks.










share|improve this question


























    1















    I am getting an issue on Magento 2.2.6 when trying to save my module record. This error occurs sometimes and the error disappears if run Magento upgrade command. But it comes again sometime.



    system.log :



    [2019-03-18 04:46:32] main.CRITICAL: Exception message: Invalid method MagentoEavModelEntityAttribute::isScopeStore
    Trace: #0 /var/www/html/test/app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php(147): MagentoFrameworkDataObject->__call('isScopeStore', Array)
    #1 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1536): VendorNameModuleNameModelResourceModelEntityName->_saveAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
    #2 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1496): MagentoEavModelEntityAbstractEntity->_insertAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
    #3 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1227): MagentoEavModelEntityAbstractEntity->_processSaveData(Array)
    #4 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1198): MagentoEavModelEntityAbstractEntity->processSave(Object(VendorNameModuleNameModelEntityName))
    #5 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoEavModelEntityAbstractEntity->save(Object(VendorNameModuleNameModelEntityName))
    #6 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callParent('save', Array)
    #7 /var/www/html/test/vendor/magento/framework/App/Cache/FlushCacheByTags.php(68): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
    #8 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoFrameworkAppCacheFlushCacheByTags->aroundSave(Object(VendorNameModuleNameModelResourceModelEntityNameInterceptor), Object(Closure), Object(VendorNameModuleNameModelEntityName))
    #9 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
    #10 /var/www/html/test/generated/code/VendorName/ModuleName/Model/ResourceModel/EntityName/Interceptor.php(468): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callPlugins('save', Array, NULL)
    #11 /var/www/html/test/vendor/magento/framework/Model/AbstractModel.php(647): VendorNameModuleNameModelResourceModelEntityNameInterceptor->save(Object(VendorNameModuleNameModelEntityName))
    #12 /var/www/html/test/app/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save.php(86): MagentoFrameworkModelAbstractModel->save()
    #13 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(24): VendorNameModuleNameControllerAdminhtmlEntityNameSave->execute()
    #14 /var/www/html/test/vendor/magento/framework/App/Action/Action.php(107): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->execute()
    #15 /var/www/html/test/vendor/magento/module-backend/App/AbstractAction.php(235): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
    #16 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoBackendAppAbstractAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
    #17 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callParent('dispatch', Array)
    #18 /var/www/html/test/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
    #19 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoBackendAppActionPluginAuthentication->aroundDispatch(Object(VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
    #20 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
    #21 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(39): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callPlugins('dispatch', Array, NULL)
    #22 /var/www/html/test/vendor/magento/framework/App/FrontController.php(55): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
    #23 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
    #24 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
    #25 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
    #26 /var/www/html/test/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
    #27 /var/www/html/test/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
    #28 /var/www/html/test/generated/code/Magento/Framework/App/Http/Interceptor.php(24): MagentoFrameworkAppHttp->launch()
    #29 /var/www/html/test/vendor/magento/framework/App/Bootstrap.php(257): MagentoFrameworkAppHttpInterceptor->launch()
    #30 /var/www/html/test/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))
    #31 main [] []
    [2019-03-18 04:47:03] main.CRITICAL: Exception message: Invalid method MagentoEavModelEntityAttribute::isScopeStore
    Trace: #0 /var/www/html/test/app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php(147): MagentoFrameworkDataObject->__call('isScopeStore', Array)
    #1 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1536): VendorNameModuleNameModelResourceModelEntityName->_saveAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
    #2 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1496): MagentoEavModelEntityAbstractEntity->_insertAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
    #3 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1227): MagentoEavModelEntityAbstractEntity->_processSaveData(Array)
    #4 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1198): MagentoEavModelEntityAbstractEntity->processSave(Object(VendorNameModuleNameModelEntityName))
    #5 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoEavModelEntityAbstractEntity->save(Object(VendorNameModuleNameModelEntityName))
    #6 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callParent('save', Array)
    #7 /var/www/html/test/vendor/magento/framework/App/Cache/FlushCacheByTags.php(68): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
    #8 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoFrameworkAppCacheFlushCacheByTags->aroundSave(Object(VendorNameModuleNameModelResourceModelEntityNameInterceptor), Object(Closure), Object(VendorNameModuleNameModelEntityName))
    #9 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
    #10 /var/www/html/test/generated/code/VendorName/ModuleName/Model/ResourceModel/EntityName/Interceptor.php(468): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callPlugins('save', Array, NULL)
    #11 /var/www/html/test/vendor/magento/framework/Model/AbstractModel.php(647): VendorNameModuleNameModelResourceModelEntityNameInterceptor->save(Object(VendorNameModuleNameModelEntityName))
    #12 /var/www/html/test/app/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save.php(86): MagentoFrameworkModelAbstractModel->save()
    #13 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(24): VendorNameModuleNameControllerAdminhtmlEntityNameSave->execute()
    #14 /var/www/html/test/vendor/magento/framework/App/Action/Action.php(107): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->execute()
    #15 /var/www/html/test/vendor/magento/module-backend/App/AbstractAction.php(235): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
    #16 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoBackendAppAbstractAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
    #17 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callParent('dispatch', Array)
    #18 /var/www/html/test/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
    #19 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoBackendAppActionPluginAuthentication->aroundDispatch(Object(VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
    #20 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
    #21 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(39): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callPlugins('dispatch', Array, NULL)
    #22 /var/www/html/test/vendor/magento/framework/App/FrontController.php(55): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
    #23 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
    #24 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
    #25 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
    #26 /var/www/html/test/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
    #27 /var/www/html/test/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
    #28 /var/www/html/test/generated/code/Magento/Framework/App/Http/Interceptor.php(24): MagentoFrameworkAppHttp->launch()
    #29 /var/www/html/test/vendor/magento/framework/App/Bootstrap.php(257): MagentoFrameworkAppHttpInterceptor->launch()
    #30 /var/www/html/test/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))
    #31 main [] []



    /app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php




    <?php

    /**
    * Copyright © Magento, Inc. All rights reserved.
    * See COPYING.txt for license details.
    */

    namespace VendorNameModuleNameModelResourceModel;

    use MagentoEavModelEntityAbstractEntity;
    use MagentoEavModelEntityContext;
    use MagentoFrameworkDataObject;
    use MagentoStoreModelStore;
    use MagentoStoreModelStoreManagerInterface;
    use VendorNameModuleNameSetupEntitySetup;

    class EntityName extends AbstractEntity
    /**
    * Store id
    *
    * @var int
    */
    protected $_storeId = null;

    /**
    * @var StoreManagerInterface
    */
    protected $_storeManager;

    /**
    * @var EntityManager
    */
    protected $entityManager;

    /**
    * [__construct description]
    * @param Context $context [description]
    * @param StoreManagerInterface $storeManager [description]
    * @param array $data [description]
    */
    public function __construct(
    Context $context,
    StoreManagerInterface $storeManager,
    array $data = []
    )
    parent::__construct($context, $data);
    $this->setType(EntitySetup::ENTITY_TYPE_CODE);
    $this->setConnection(EntitySetup::ENTITY_TYPE_CODE . '_read', EntitySetup::ENTITY_TYPE_CODE . '_write');
    $this->_storeManager = $storeManager;


    /**
    * Set attribute set id and entity type id value
    *
    * @param MagentoFrameworkDataObject $customer
    * @return $this
    * @throws MagentoFrameworkExceptionLocalizedException
    * @SuppressWarnings(PHPMD.CyclomaticComplexity)
    * @SuppressWarnings(PHPMD.NPathComplexity)
    */
    protected function _beforeSave(MagentoFrameworkDataObject $object)
    $object->setAttributeSetId($object->getAttributeSetId() ?: $this->getEntityType()->getDefaultAttributeSetId());
    $object->setEntityTypeId($object->getEntityTypeId() ?: $this->getEntityType()->getEntityTypeId());
    return parent::_beforeSave($object);


    /**
    * Return Entity Type instance
    *
    * @return MagentoEavModelEntityType
    */
    public function getEntityType()
    if (empty($this->_type))
    $this->setType(EntitySetup::ENTITY_TYPE_CODE);

    return parent::getEntityType();


    /**
    * Retrieve ProductFaqNew entity default attributes
    *
    * @return string[]
    */
    protected function _getDefaultAttributes()
    return [
    'attribute_set_id',
    'entity_type_id',
    'created_at',
    'updated_at',
    ];


    /**
    * Set store Id
    *
    * @param integer $storeId
    * @return $this
    */
    public function setStoreId($storeId)
    $this->_storeId = $storeId;
    return $this;


    /**
    * Return store id
    *
    * @return integer
    */
    public function getStoreId()
    if ($this->_storeId === null)
    return $this->_storeManager->getStore()->getId();

    return $this->_storeId;


    /**
    * Set Attribute values to be saved
    *
    * @param MagentoFrameworkModelAbstractModel $object
    * @param MagentoEavModelEntityAttributeAbstractAttribute $attribute
    * @param mixed $value
    * @return $this
    */
    protected function _saveAttribute($object, $attribute, $value) $this->getEntityTable() == MagentoEavModelEntity::DEFAULT_ENTITY_TABLE)
    $data['entity_type_id'] = $object->getEntityTypeId();


    if ($attribute->isScopeStore())
    /**
    * Update attribute value for store
    */
    $this->_attributeValuesToSave[$table][] = $data;
    elseif ($attribute->isScopeWebsite() && $storeId != Store::DEFAULT_STORE_ID)
    /**
    * Update attribute value for website
    */
    $storeIds = $this->_storeManager->getStore($storeId)->getWebsite()->getStoreIds(true);
    foreach ($storeIds as $storeId)
    $data['store_id'] = (int) $storeId;
    $this->_attributeValuesToSave[$table][] = $data;

    else
    /**
    * Update global attribute value
    */
    $data['store_id'] = Store::DEFAULT_STORE_ID;
    $this->_attributeValuesToSave[$table][] = $data;


    return $this;




    what should I need to change?



    Any help would be appriciated.



    Thanks.










    share|improve this question
























      1












      1








      1








      I am getting an issue on Magento 2.2.6 when trying to save my module record. This error occurs sometimes and the error disappears if run Magento upgrade command. But it comes again sometime.



      system.log :



      [2019-03-18 04:46:32] main.CRITICAL: Exception message: Invalid method MagentoEavModelEntityAttribute::isScopeStore
      Trace: #0 /var/www/html/test/app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php(147): MagentoFrameworkDataObject->__call('isScopeStore', Array)
      #1 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1536): VendorNameModuleNameModelResourceModelEntityName->_saveAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
      #2 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1496): MagentoEavModelEntityAbstractEntity->_insertAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
      #3 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1227): MagentoEavModelEntityAbstractEntity->_processSaveData(Array)
      #4 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1198): MagentoEavModelEntityAbstractEntity->processSave(Object(VendorNameModuleNameModelEntityName))
      #5 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoEavModelEntityAbstractEntity->save(Object(VendorNameModuleNameModelEntityName))
      #6 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callParent('save', Array)
      #7 /var/www/html/test/vendor/magento/framework/App/Cache/FlushCacheByTags.php(68): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
      #8 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoFrameworkAppCacheFlushCacheByTags->aroundSave(Object(VendorNameModuleNameModelResourceModelEntityNameInterceptor), Object(Closure), Object(VendorNameModuleNameModelEntityName))
      #9 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
      #10 /var/www/html/test/generated/code/VendorName/ModuleName/Model/ResourceModel/EntityName/Interceptor.php(468): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callPlugins('save', Array, NULL)
      #11 /var/www/html/test/vendor/magento/framework/Model/AbstractModel.php(647): VendorNameModuleNameModelResourceModelEntityNameInterceptor->save(Object(VendorNameModuleNameModelEntityName))
      #12 /var/www/html/test/app/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save.php(86): MagentoFrameworkModelAbstractModel->save()
      #13 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(24): VendorNameModuleNameControllerAdminhtmlEntityNameSave->execute()
      #14 /var/www/html/test/vendor/magento/framework/App/Action/Action.php(107): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->execute()
      #15 /var/www/html/test/vendor/magento/module-backend/App/AbstractAction.php(235): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #16 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoBackendAppAbstractAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #17 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callParent('dispatch', Array)
      #18 /var/www/html/test/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #19 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoBackendAppActionPluginAuthentication->aroundDispatch(Object(VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
      #20 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #21 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(39): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callPlugins('dispatch', Array, NULL)
      #22 /var/www/html/test/vendor/magento/framework/App/FrontController.php(55): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #23 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #24 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
      #25 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #26 /var/www/html/test/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
      #27 /var/www/html/test/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #28 /var/www/html/test/generated/code/Magento/Framework/App/Http/Interceptor.php(24): MagentoFrameworkAppHttp->launch()
      #29 /var/www/html/test/vendor/magento/framework/App/Bootstrap.php(257): MagentoFrameworkAppHttpInterceptor->launch()
      #30 /var/www/html/test/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))
      #31 main [] []
      [2019-03-18 04:47:03] main.CRITICAL: Exception message: Invalid method MagentoEavModelEntityAttribute::isScopeStore
      Trace: #0 /var/www/html/test/app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php(147): MagentoFrameworkDataObject->__call('isScopeStore', Array)
      #1 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1536): VendorNameModuleNameModelResourceModelEntityName->_saveAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
      #2 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1496): MagentoEavModelEntityAbstractEntity->_insertAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
      #3 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1227): MagentoEavModelEntityAbstractEntity->_processSaveData(Array)
      #4 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1198): MagentoEavModelEntityAbstractEntity->processSave(Object(VendorNameModuleNameModelEntityName))
      #5 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoEavModelEntityAbstractEntity->save(Object(VendorNameModuleNameModelEntityName))
      #6 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callParent('save', Array)
      #7 /var/www/html/test/vendor/magento/framework/App/Cache/FlushCacheByTags.php(68): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
      #8 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoFrameworkAppCacheFlushCacheByTags->aroundSave(Object(VendorNameModuleNameModelResourceModelEntityNameInterceptor), Object(Closure), Object(VendorNameModuleNameModelEntityName))
      #9 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
      #10 /var/www/html/test/generated/code/VendorName/ModuleName/Model/ResourceModel/EntityName/Interceptor.php(468): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callPlugins('save', Array, NULL)
      #11 /var/www/html/test/vendor/magento/framework/Model/AbstractModel.php(647): VendorNameModuleNameModelResourceModelEntityNameInterceptor->save(Object(VendorNameModuleNameModelEntityName))
      #12 /var/www/html/test/app/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save.php(86): MagentoFrameworkModelAbstractModel->save()
      #13 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(24): VendorNameModuleNameControllerAdminhtmlEntityNameSave->execute()
      #14 /var/www/html/test/vendor/magento/framework/App/Action/Action.php(107): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->execute()
      #15 /var/www/html/test/vendor/magento/module-backend/App/AbstractAction.php(235): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #16 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoBackendAppAbstractAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #17 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callParent('dispatch', Array)
      #18 /var/www/html/test/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #19 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoBackendAppActionPluginAuthentication->aroundDispatch(Object(VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
      #20 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #21 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(39): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callPlugins('dispatch', Array, NULL)
      #22 /var/www/html/test/vendor/magento/framework/App/FrontController.php(55): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #23 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #24 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
      #25 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #26 /var/www/html/test/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
      #27 /var/www/html/test/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #28 /var/www/html/test/generated/code/Magento/Framework/App/Http/Interceptor.php(24): MagentoFrameworkAppHttp->launch()
      #29 /var/www/html/test/vendor/magento/framework/App/Bootstrap.php(257): MagentoFrameworkAppHttpInterceptor->launch()
      #30 /var/www/html/test/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))
      #31 main [] []



      /app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php




      <?php

      /**
      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */

      namespace VendorNameModuleNameModelResourceModel;

      use MagentoEavModelEntityAbstractEntity;
      use MagentoEavModelEntityContext;
      use MagentoFrameworkDataObject;
      use MagentoStoreModelStore;
      use MagentoStoreModelStoreManagerInterface;
      use VendorNameModuleNameSetupEntitySetup;

      class EntityName extends AbstractEntity
      /**
      * Store id
      *
      * @var int
      */
      protected $_storeId = null;

      /**
      * @var StoreManagerInterface
      */
      protected $_storeManager;

      /**
      * @var EntityManager
      */
      protected $entityManager;

      /**
      * [__construct description]
      * @param Context $context [description]
      * @param StoreManagerInterface $storeManager [description]
      * @param array $data [description]
      */
      public function __construct(
      Context $context,
      StoreManagerInterface $storeManager,
      array $data = []
      )
      parent::__construct($context, $data);
      $this->setType(EntitySetup::ENTITY_TYPE_CODE);
      $this->setConnection(EntitySetup::ENTITY_TYPE_CODE . '_read', EntitySetup::ENTITY_TYPE_CODE . '_write');
      $this->_storeManager = $storeManager;


      /**
      * Set attribute set id and entity type id value
      *
      * @param MagentoFrameworkDataObject $customer
      * @return $this
      * @throws MagentoFrameworkExceptionLocalizedException
      * @SuppressWarnings(PHPMD.CyclomaticComplexity)
      * @SuppressWarnings(PHPMD.NPathComplexity)
      */
      protected function _beforeSave(MagentoFrameworkDataObject $object)
      $object->setAttributeSetId($object->getAttributeSetId() ?: $this->getEntityType()->getDefaultAttributeSetId());
      $object->setEntityTypeId($object->getEntityTypeId() ?: $this->getEntityType()->getEntityTypeId());
      return parent::_beforeSave($object);


      /**
      * Return Entity Type instance
      *
      * @return MagentoEavModelEntityType
      */
      public function getEntityType()
      if (empty($this->_type))
      $this->setType(EntitySetup::ENTITY_TYPE_CODE);

      return parent::getEntityType();


      /**
      * Retrieve ProductFaqNew entity default attributes
      *
      * @return string[]
      */
      protected function _getDefaultAttributes()
      return [
      'attribute_set_id',
      'entity_type_id',
      'created_at',
      'updated_at',
      ];


      /**
      * Set store Id
      *
      * @param integer $storeId
      * @return $this
      */
      public function setStoreId($storeId)
      $this->_storeId = $storeId;
      return $this;


      /**
      * Return store id
      *
      * @return integer
      */
      public function getStoreId()
      if ($this->_storeId === null)
      return $this->_storeManager->getStore()->getId();

      return $this->_storeId;


      /**
      * Set Attribute values to be saved
      *
      * @param MagentoFrameworkModelAbstractModel $object
      * @param MagentoEavModelEntityAttributeAbstractAttribute $attribute
      * @param mixed $value
      * @return $this
      */
      protected function _saveAttribute($object, $attribute, $value) $this->getEntityTable() == MagentoEavModelEntity::DEFAULT_ENTITY_TABLE)
      $data['entity_type_id'] = $object->getEntityTypeId();


      if ($attribute->isScopeStore())
      /**
      * Update attribute value for store
      */
      $this->_attributeValuesToSave[$table][] = $data;
      elseif ($attribute->isScopeWebsite() && $storeId != Store::DEFAULT_STORE_ID)
      /**
      * Update attribute value for website
      */
      $storeIds = $this->_storeManager->getStore($storeId)->getWebsite()->getStoreIds(true);
      foreach ($storeIds as $storeId)
      $data['store_id'] = (int) $storeId;
      $this->_attributeValuesToSave[$table][] = $data;

      else
      /**
      * Update global attribute value
      */
      $data['store_id'] = Store::DEFAULT_STORE_ID;
      $this->_attributeValuesToSave[$table][] = $data;


      return $this;




      what should I need to change?



      Any help would be appriciated.



      Thanks.










      share|improve this question














      I am getting an issue on Magento 2.2.6 when trying to save my module record. This error occurs sometimes and the error disappears if run Magento upgrade command. But it comes again sometime.



      system.log :



      [2019-03-18 04:46:32] main.CRITICAL: Exception message: Invalid method MagentoEavModelEntityAttribute::isScopeStore
      Trace: #0 /var/www/html/test/app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php(147): MagentoFrameworkDataObject->__call('isScopeStore', Array)
      #1 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1536): VendorNameModuleNameModelResourceModelEntityName->_saveAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
      #2 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1496): MagentoEavModelEntityAbstractEntity->_insertAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
      #3 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1227): MagentoEavModelEntityAbstractEntity->_processSaveData(Array)
      #4 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1198): MagentoEavModelEntityAbstractEntity->processSave(Object(VendorNameModuleNameModelEntityName))
      #5 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoEavModelEntityAbstractEntity->save(Object(VendorNameModuleNameModelEntityName))
      #6 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callParent('save', Array)
      #7 /var/www/html/test/vendor/magento/framework/App/Cache/FlushCacheByTags.php(68): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
      #8 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoFrameworkAppCacheFlushCacheByTags->aroundSave(Object(VendorNameModuleNameModelResourceModelEntityNameInterceptor), Object(Closure), Object(VendorNameModuleNameModelEntityName))
      #9 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
      #10 /var/www/html/test/generated/code/VendorName/ModuleName/Model/ResourceModel/EntityName/Interceptor.php(468): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callPlugins('save', Array, NULL)
      #11 /var/www/html/test/vendor/magento/framework/Model/AbstractModel.php(647): VendorNameModuleNameModelResourceModelEntityNameInterceptor->save(Object(VendorNameModuleNameModelEntityName))
      #12 /var/www/html/test/app/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save.php(86): MagentoFrameworkModelAbstractModel->save()
      #13 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(24): VendorNameModuleNameControllerAdminhtmlEntityNameSave->execute()
      #14 /var/www/html/test/vendor/magento/framework/App/Action/Action.php(107): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->execute()
      #15 /var/www/html/test/vendor/magento/module-backend/App/AbstractAction.php(235): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #16 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoBackendAppAbstractAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #17 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callParent('dispatch', Array)
      #18 /var/www/html/test/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #19 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoBackendAppActionPluginAuthentication->aroundDispatch(Object(VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
      #20 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #21 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(39): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callPlugins('dispatch', Array, NULL)
      #22 /var/www/html/test/vendor/magento/framework/App/FrontController.php(55): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #23 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #24 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
      #25 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #26 /var/www/html/test/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
      #27 /var/www/html/test/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #28 /var/www/html/test/generated/code/Magento/Framework/App/Http/Interceptor.php(24): MagentoFrameworkAppHttp->launch()
      #29 /var/www/html/test/vendor/magento/framework/App/Bootstrap.php(257): MagentoFrameworkAppHttpInterceptor->launch()
      #30 /var/www/html/test/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))
      #31 main [] []
      [2019-03-18 04:47:03] main.CRITICAL: Exception message: Invalid method MagentoEavModelEntityAttribute::isScopeStore
      Trace: #0 /var/www/html/test/app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php(147): MagentoFrameworkDataObject->__call('isScopeStore', Array)
      #1 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1536): VendorNameModuleNameModelResourceModelEntityName->_saveAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
      #2 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1496): MagentoEavModelEntityAbstractEntity->_insertAttribute(Object(VendorNameModuleNameModelEntityName), Object(MagentoEavModelEntityAttribute), '0')
      #3 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1227): MagentoEavModelEntityAbstractEntity->_processSaveData(Array)
      #4 /var/www/html/test/vendor/magento/module-eav/Model/Entity/AbstractEntity.php(1198): MagentoEavModelEntityAbstractEntity->processSave(Object(VendorNameModuleNameModelEntityName))
      #5 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoEavModelEntityAbstractEntity->save(Object(VendorNameModuleNameModelEntityName))
      #6 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callParent('save', Array)
      #7 /var/www/html/test/vendor/magento/framework/App/Cache/FlushCacheByTags.php(68): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
      #8 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoFrameworkAppCacheFlushCacheByTags->aroundSave(Object(VendorNameModuleNameModelResourceModelEntityNameInterceptor), Object(Closure), Object(VendorNameModuleNameModelEntityName))
      #9 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameModelResourceModelEntityNameInterceptor->MagentoFrameworkInterceptionclosure(Object(VendorNameModuleNameModelEntityName))
      #10 /var/www/html/test/generated/code/VendorName/ModuleName/Model/ResourceModel/EntityName/Interceptor.php(468): VendorNameModuleNameModelResourceModelEntityNameInterceptor->___callPlugins('save', Array, NULL)
      #11 /var/www/html/test/vendor/magento/framework/Model/AbstractModel.php(647): VendorNameModuleNameModelResourceModelEntityNameInterceptor->save(Object(VendorNameModuleNameModelEntityName))
      #12 /var/www/html/test/app/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save.php(86): MagentoFrameworkModelAbstractModel->save()
      #13 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(24): VendorNameModuleNameControllerAdminhtmlEntityNameSave->execute()
      #14 /var/www/html/test/vendor/magento/framework/App/Action/Action.php(107): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->execute()
      #15 /var/www/html/test/vendor/magento/module-backend/App/AbstractAction.php(235): MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #16 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoBackendAppAbstractAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #17 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callParent('dispatch', Array)
      #18 /var/www/html/test/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #19 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(135): MagentoBackendAppActionPluginAuthentication->aroundDispatch(Object(VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor), Object(Closure), Object(MagentoFrameworkAppRequestHttp))
      #20 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #21 /var/www/html/test/generated/code/VendorName/ModuleName/Controller/Adminhtml/EntityName/Save/Interceptor.php(39): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->___callPlugins('dispatch', Array, NULL)
      #22 /var/www/html/test/vendor/magento/framework/App/FrontController.php(55): VendorNameModuleNameControllerAdminhtmlEntityNameSaveInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #23 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(58): MagentoFrameworkAppFrontController->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #24 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(138): MagentoFrameworkAppFrontControllerInterceptor->___callParent('dispatch', Array)
      #25 /var/www/html/test/vendor/magento/framework/Interception/Interceptor.php(153): MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
      #26 /var/www/html/test/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): MagentoFrameworkAppFrontControllerInterceptor->___callPlugins('dispatch', Array, Array)
      #27 /var/www/html/test/vendor/magento/framework/App/Http.php(135): MagentoFrameworkAppFrontControllerInterceptor->dispatch(Object(MagentoFrameworkAppRequestHttp))
      #28 /var/www/html/test/generated/code/Magento/Framework/App/Http/Interceptor.php(24): MagentoFrameworkAppHttp->launch()
      #29 /var/www/html/test/vendor/magento/framework/App/Bootstrap.php(257): MagentoFrameworkAppHttpInterceptor->launch()
      #30 /var/www/html/test/index.php(39): MagentoFrameworkAppBootstrap->run(Object(MagentoFrameworkAppHttpInterceptor))
      #31 main [] []



      /app/code/VendorName/ModuleName/Model/ResourceModel/EntityName.php




      <?php

      /**
      * Copyright © Magento, Inc. All rights reserved.
      * See COPYING.txt for license details.
      */

      namespace VendorNameModuleNameModelResourceModel;

      use MagentoEavModelEntityAbstractEntity;
      use MagentoEavModelEntityContext;
      use MagentoFrameworkDataObject;
      use MagentoStoreModelStore;
      use MagentoStoreModelStoreManagerInterface;
      use VendorNameModuleNameSetupEntitySetup;

      class EntityName extends AbstractEntity
      /**
      * Store id
      *
      * @var int
      */
      protected $_storeId = null;

      /**
      * @var StoreManagerInterface
      */
      protected $_storeManager;

      /**
      * @var EntityManager
      */
      protected $entityManager;

      /**
      * [__construct description]
      * @param Context $context [description]
      * @param StoreManagerInterface $storeManager [description]
      * @param array $data [description]
      */
      public function __construct(
      Context $context,
      StoreManagerInterface $storeManager,
      array $data = []
      )
      parent::__construct($context, $data);
      $this->setType(EntitySetup::ENTITY_TYPE_CODE);
      $this->setConnection(EntitySetup::ENTITY_TYPE_CODE . '_read', EntitySetup::ENTITY_TYPE_CODE . '_write');
      $this->_storeManager = $storeManager;


      /**
      * Set attribute set id and entity type id value
      *
      * @param MagentoFrameworkDataObject $customer
      * @return $this
      * @throws MagentoFrameworkExceptionLocalizedException
      * @SuppressWarnings(PHPMD.CyclomaticComplexity)
      * @SuppressWarnings(PHPMD.NPathComplexity)
      */
      protected function _beforeSave(MagentoFrameworkDataObject $object)
      $object->setAttributeSetId($object->getAttributeSetId() ?: $this->getEntityType()->getDefaultAttributeSetId());
      $object->setEntityTypeId($object->getEntityTypeId() ?: $this->getEntityType()->getEntityTypeId());
      return parent::_beforeSave($object);


      /**
      * Return Entity Type instance
      *
      * @return MagentoEavModelEntityType
      */
      public function getEntityType()
      if (empty($this->_type))
      $this->setType(EntitySetup::ENTITY_TYPE_CODE);

      return parent::getEntityType();


      /**
      * Retrieve ProductFaqNew entity default attributes
      *
      * @return string[]
      */
      protected function _getDefaultAttributes()
      return [
      'attribute_set_id',
      'entity_type_id',
      'created_at',
      'updated_at',
      ];


      /**
      * Set store Id
      *
      * @param integer $storeId
      * @return $this
      */
      public function setStoreId($storeId)
      $this->_storeId = $storeId;
      return $this;


      /**
      * Return store id
      *
      * @return integer
      */
      public function getStoreId()
      if ($this->_storeId === null)
      return $this->_storeManager->getStore()->getId();

      return $this->_storeId;


      /**
      * Set Attribute values to be saved
      *
      * @param MagentoFrameworkModelAbstractModel $object
      * @param MagentoEavModelEntityAttributeAbstractAttribute $attribute
      * @param mixed $value
      * @return $this
      */
      protected function _saveAttribute($object, $attribute, $value) $this->getEntityTable() == MagentoEavModelEntity::DEFAULT_ENTITY_TABLE)
      $data['entity_type_id'] = $object->getEntityTypeId();


      if ($attribute->isScopeStore())
      /**
      * Update attribute value for store
      */
      $this->_attributeValuesToSave[$table][] = $data;
      elseif ($attribute->isScopeWebsite() && $storeId != Store::DEFAULT_STORE_ID)
      /**
      * Update attribute value for website
      */
      $storeIds = $this->_storeManager->getStore($storeId)->getWebsite()->getStoreIds(true);
      foreach ($storeIds as $storeId)
      $data['store_id'] = (int) $storeId;
      $this->_attributeValuesToSave[$table][] = $data;

      else
      /**
      * Update global attribute value
      */
      $data['store_id'] = Store::DEFAULT_STORE_ID;
      $this->_attributeValuesToSave[$table][] = $data;


      return $this;




      what should I need to change?



      Any help would be appriciated.



      Thanks.







      magento2 eav entity-manager






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 13 mins ago









      Rohan HapaniRohan Hapani

      6,56831864




      6,56831864




















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266244%2fmagento-2-invalid-method-magento-eav-model-entity-attributeisscopestore%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266244%2fmagento-2-invalid-method-magento-eav-model-entity-attributeisscopestore%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

          Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

          How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2