-
Notifications
You must be signed in to change notification settings - Fork 1
/
Index.php
34 lines (28 loc) · 937 Bytes
/
Index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace Taggrs\DataLayer\Controller\GetQuoteData;
use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Controller\Result\JsonFactory;
use Psr\Log\LoggerInterface;
use Taggrs\DataLayer\Helper\QuoteDataHelper;
class Index implements HttpGetActionInterface
{
private QuoteDataHelper $quoteDataHelper;
private JsonFactory $jsonFactory;
/**
* @param QuoteDataHelper $quoteDataHelper
* @param JsonFactory $jsonFactory
*/
public function __construct(QuoteDataHelper $quoteDataHelper, JsonFactory $jsonFactory)
{
$this->quoteDataHelper = $quoteDataHelper;
$this->jsonFactory = $jsonFactory;
}
public function execute()
{
$quoteData = $this->quoteDataHelper->getQuoteData();
$result = $this->jsonFactory->create();
$result->setData($quoteData);
return $result;
}
}