init
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Esun\CustomerMessage\ViewModel;
|
||||
|
||||
use Esun\CustomerMessage\Model\ConversationService;
|
||||
use Magento\Customer\Model\Session;
|
||||
use Magento\Framework\View\Element\Block\ArgumentInterface;
|
||||
|
||||
class OrderUnread implements ArgumentInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly Session $session,
|
||||
private readonly ConversationService $conversations
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int[] $orderIds
|
||||
* @return array<int, int>
|
||||
*/
|
||||
public function getUnreadCounts(array $orderIds): array
|
||||
{
|
||||
return $this->conversations->getCustomerUnreadByOrderIds(
|
||||
(int)$this->session->getCustomerId(),
|
||||
$orderIds
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user