I am working on admin notification area where I want to show on message which is related to currently logged-in user. I have created a column in db with user_id where after some functionally I push message with specific userID. now I want that when that specific user logged in he see all messages where
userId == currentLoggedInUserID
adminhtml_notification_block.xml this is the layout file where the collection file is placed. Now, when I create my custom collection file and extend the protected function
_initSelect()
protected function _initSelect()
{
$currentUserId = $this->adminSession->getUser()->getId();
parent::_initSelect();
$this->addFieldToFilter('brand_user', $currentUserId);
$this->addRemoveFilter();
return $this;
it throws a NULL error because I can not get the session of the admin user in the collection file. what is the suggestion for this, please?