本文整理汇总了PHP中Magento\Framework\Model\Context::getLogger方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getLogger方法的具体用法?PHP Context::getLogger怎么用?PHP Context::getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Model\Context
的用法示例。
在下文中一共展示了Context::getLogger方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Module\Dir\Reader $configReader, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Mehulchaudhari\Geoip\Helper\Data $geoipHelper, array $data = [])
{
$this->_geoipHelper = $geoipHelper;
$this->_logger = $context->getLogger();
$this->_scopeConfig = $scopeConfig;
$this->_storeManager = $storeManager;
$this->libpath = $configReader->getModuleDir('', 'Mehulchaudhari_Geoip');
if (!function_exists('geoip_country_code_by_name') && $this->_geoipHelper->getConfig('general/apache_or_file') == 1) {
define('GEOIP_LOCAL', 1);
$geoIpInc = $this->libpath . '/lib/geoip.inc';
include $geoIpInc;
}
}
示例2: __construct
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
* @param array $data
*/
public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\Resource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\Db $resourceCollection = null, array $data = [])
{
$this->_registry = $registry;
$this->_appState = $context->getAppState();
$this->_eventManager = $context->getEventDispatcher();
$this->_cacheManager = $context->getCacheManager();
$this->_resource = $resource;
$this->_resourceCollection = $resourceCollection;
$this->_logger = $context->getLogger();
$this->_actionValidator = $context->getActionValidator();
if (method_exists($this->_resource, 'getIdFieldName') || $this->_resource instanceof \Magento\Framework\Object) {
$this->_idFieldName = $this->_getResource()->getIdFieldName();
}
parent::__construct($data);
$this->_construct();
}