本文整理匯總了PHP中Magento\Store\Model\Store::getGroup方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::getGroup方法的具體用法?PHP Store::getGroup怎麽用?PHP Store::getGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Store\Model\Store
的用法示例。
在下文中一共展示了Store::getGroup方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testSetGetGroup
public function testSetGetGroup()
{
$this->assertFalse($this->model->getGroup());
$storeGroup = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManager')->getGroup();
$this->model->setGroup($storeGroup);
$actualResult = $this->model->getGroup();
$this->assertSame($storeGroup, $actualResult);
}
示例2: build
/**
* @param Store $store
* @return \NostoAccount
*/
public function build(Store $store)
{
$metaData = new \NostoAccount();
try {
$metaData->setTitle(implode(' - ', [$store->getWebsite()->getName(), $store->getGroup()->getName(), $store->getName()]));
$metaData->setName(substr(sha1(rand()), 0, 8));
$metaData->setFrontPageUrl(\NostoHttpRequest::replaceQueryParamInUrl('___store', $store->getCode(), $store->getBaseUrl(UrlInterface::URL_TYPE_WEB)));
$metaData->setCurrency(new \NostoCurrencyCode($store->getBaseCurrencyCode()));
$lang = substr($store->getConfig('general/locale/code'), 0, 2);
$metaData->setLanguage(new \NostoLanguageCode($lang));
$lang = substr($this->_localeResolver->getLocale(), 0, 2);
$metaData->setOwnerLanguage(new \NostoLanguageCode($lang));
$owner = $this->_accountOwnerMetaBuilder->build();
$metaData->setOwner($owner);
$billing = $this->_accountBillingMetaBuilder->build($store);
$metaData->setBilling($billing);
} catch (\NostoException $e) {
$this->_logger->error($e, ['exception' => $e]);
}
return $metaData;
}
示例3: getGroup
/**
* {@inheritdoc}
*/
public function getGroup()
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'getGroup');
if (!$pluginInfo) {
return parent::getGroup();
} else {
return $this->___callPlugins('getGroup', func_get_args(), $pluginInfo);
}
}
示例4: prepareGroupIdField
/**
* Prepare group id field in the fieldset
*
* @param \Magento\Framework\Data\Form $form
* @param \Magento\Store\Model\Store $storeModel
* @param \Magento\Framework\Data\Form\Element\Fieldset $fieldset
* @return \Magento\Framework\Data\Form\Element\Fieldset
*/
private function prepareGroupIdField(\Magento\Framework\Data\Form $form, \Magento\Store\Model\Store $storeModel, \Magento\Framework\Data\Form\Element\Fieldset $fieldset)
{
if ($storeModel->getId() && $storeModel->getGroup()->getDefaultStoreId() == $storeModel->getId()) {
if ($storeModel->getGroup() && $storeModel->getGroup()->getStoresCount() > 1) {
$form->getElement('store_group_id')->setDisabled(true);
$fieldset->addField('store_hidden_group_id', 'hidden', ['name' => 'store[group_id]', 'no_span' => true, 'value' => $storeModel->getGroupId()]);
} else {
$fieldset->addField('store_original_group_id', 'hidden', ['name' => 'store[original_group_id]', 'no_span' => true, 'value' => $storeModel->getGroupId()]);
}
}
return $fieldset;
}