By default store manager loads current store information. You can get store information by `store_id` parameter.You must create an instance of
\Magento\Store\Model\StoreManagerInterface class to get store information.
<?php
...
private $storeManager ;
public function __construct(\Magento\Store\Model\StoreManagerInterface $storeManager ) {
$this ->storeManager = $storeManager ;
}
public function getStoreId()
{
return $this ->getStore()->getId();
}
public function getStoreCode()
{
return $this ->getStore()->getCode();
}
public function getStoreName()
{
return $this ->getStore()->getName();
}
public function getStore()
{
return $this ->storeManager->getStore();
}
public function getStoreById( $storeId )
{
return $this ->storeManager->getStore( $storeId );
}
...
|