44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
| <?php
 | |
| namespace Kai\Banner\Block\Adminhtml;
 | |
| 
 | |
| use Magento\Backend\Block\Template;
 | |
| 
 | |
| class Index extends Template
 | |
| {
 | |
|     protected $urlInterface;
 | |
|     protected $kaiBanner;
 | |
|     protected $kaiBannerCollection;
 | |
|     protected $kaiBannerResourceModel;
 | |
| 
 | |
|     public function __construct(
 | |
|         \Magento\Backend\Block\Template\Context $context,
 | |
|         \Magento\Backend\Model\UrlInterface $urlInterface,
 | |
|         \Kai\Banner\Model\KaiBanner $kaiBanner,
 | |
|         \Kai\Banner\Model\KaiBannerResourceModel $kaiBannerResourceModel,
 | |
|         \Kai\Banner\Model\KaiBannerCollection $kaiBannerCollection,
 | |
|         $data = []
 | |
|     )
 | |
|     {
 | |
|         $this->urlInterface = $urlInterface;
 | |
|         $this->kaiBanner = $kaiBanner;
 | |
|         $this->kaiBannerResourceModel = $kaiBannerResourceModel;
 | |
|         $this->kaiBannerCollection = $kaiBannerCollection;
 | |
|         parent::__construct($context, $data);
 | |
|     }
 | |
| 
 | |
|     public function getSecretKey()
 | |
|     {
 | |
|         return $this->urlInterface->getSecretKey();
 | |
|     }
 | |
| 
 | |
|     public function getApiKey()
 | |
|     {
 | |
|         return \Kai\Banner\Api\Helper::API_KEY;
 | |
|     }
 | |
| 
 | |
|     public function getAll()
 | |
|     {
 | |
|         return $this->kaiBannerCollection->getData();
 | |
|     }
 | |
| }
 |