Hi Here I have created a extra column school
in the table Admin_user
. While I trying to update or save it inside a "PLUGIN"
its giving me error.
Here is my Plugin
code
class Adminsave
{
protected $userCollectionFactory;
public function __construct(\Magento\User\Model\ResourceModel\User\CollectionFactory $userCollectionFactory)
{$this->userCollectionFactory = $userCollectionFactory;}
public function aroundexecute(\Magento\User\Controller\Adminhtml\User\Save $save)
{
$set = $this->userCollectionFactory->create();
$set->setUserId(3);
$set->setSchool(5);
$set->save();
}
}
Error: Call to undefined method Magento\User\Model\ResourceModel\User\Collection::setUserId()
Where am Doing wrong? Can i get help? Thank you in advance