|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / dev2.destoffenstraat.com / app / code / SR / Banner / Helper / |
Filename | /home/dev2.destoffenstraat.com/app/code/SR/Banner/Helper/Data.php |
Size | 904 |
Permission | rwxrwxrwx |
Owner | root : root |
Create time | 17-Aug-2025 10:26 |
Last modified | 28-Jan-2025 07:12 |
Last accessed | 22-Aug-2025 21:47 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
namespace SR\Banner\Helper;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Store\Model\StoreManagerInterface;
class Data extends AbstractHelper {
/**
* @var \Magento\Framework\App\Http\Context
*/
private $httpContext;
public function __construct(
\Magento\Framework\App\Helper\Context $context,
StoreManagerInterface $storeManager,
\SR\Banner\Model\ResourceModel\Banner\Collection $bannerCollection
) {
parent::__construct($context);
$this->_bannerCollection = $bannerCollection;
$this->storeManager = $storeManager;
}
public function getBannercollection() {
$collection = $this->_bannerCollection->addFieldToFilter('status', 1)->setOrder('position', 'asc');
$collection->getSelect()
->where('FIND_IN_SET(0, store_ids) OR FIND_IN_SET(?, store_ids)', $this->storeManager->getStore()->getId());
return $collection;
}
}
namespace SR\Banner\Helper;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Store\Model\StoreManagerInterface;
class Data extends AbstractHelper {
/**
* @var \Magento\Framework\App\Http\Context
*/
private $httpContext;
public function __construct(
\Magento\Framework\App\Helper\Context $context,
StoreManagerInterface $storeManager,
\SR\Banner\Model\ResourceModel\Banner\Collection $bannerCollection
) {
parent::__construct($context);
$this->_bannerCollection = $bannerCollection;
$this->storeManager = $storeManager;
}
public function getBannercollection() {
$collection = $this->_bannerCollection->addFieldToFilter('status', 1)->setOrder('position', 'asc');
$collection->getSelect()
->where('FIND_IN_SET(0, store_ids) OR FIND_IN_SET(?, store_ids)', $this->storeManager->getStore()->getId());
return $collection;
}
}