当前位置: 首页>>代码示例>>PHP>>正文


PHP Repository::createAsset方法代码示例

本文整理汇总了PHP中Repository::createAsset方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::createAsset方法的具体用法?PHP Repository::createAsset怎么用?PHP Repository::createAsset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Repository的用法示例。


在下文中一共展示了Repository::createAsset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _fetchHppMethods

 /**
  * @param $store
  * @param $country
  * @return array
  */
 protected function _fetchHppMethods($store, $country)
 {
     $skinCode = $this->_adyenHelper->getAdyenHppConfigData('skin_code');
     $merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData('merchant_account');
     if (!$skinCode || !$merchantAccount) {
         return [];
     }
     $adyFields = ["paymentAmount" => (int) $this->_adyenHelper->formatAmount($this->_getCurrentPaymentAmount(), $this->_getCurrentCurrencyCode($store)), "currencyCode" => $this->_getCurrentCurrencyCode($store), "merchantReference" => "Get Payment methods", "skinCode" => $skinCode, "merchantAccount" => $merchantAccount, "sessionValidity" => date(DATE_ATOM, mktime(date("H") + 1, date("i"), date("s"), date("m"), date("j"), date("Y"))), "countryCode" => $this->_getCurrentCountryCode($store, $country), "shopperLocale" => $this->_getCurrentLocaleCode($store)];
     $responseData = $this->_getDirectoryLookupResponse($adyFields, $store);
     $paymentMethods = [];
     if (isset($responseData['paymentMethods'])) {
         foreach ($responseData['paymentMethods'] as $paymentMethod) {
             $paymentMethodCode = $paymentMethod['brandCode'];
             $paymentMethod = $this->_fieldMapPaymentMethod($paymentMethod);
             // check if payment method is an openinvoice method
             $paymentMethod['isPaymentMethodOpenInvoiceMethod'] = $this->_adyenHelper->isPaymentMethodOpenInvoiceMethod($paymentMethodCode);
             // add icon location in result
             if ($this->_adyenHelper->showLogos()) {
                 $params = [];
                 // use frontend area
                 $params = array_merge(['area' => 'frontend', '_secure' => $this->_request->isSecure()], $params);
                 $asset = $this->_assetRepo->createAsset('Adyen_Payment::images/logos/' . $paymentMethodCode . '.png', $params);
                 $placeholder = $this->_assetSource->findSource($asset);
                 $icon = null;
                 if ($placeholder) {
                     list($width, $height) = getimagesize($asset->getSourceFile());
                     $icon = ['url' => $asset->getUrl(), 'width' => $width, 'height' => $height];
                 }
                 $paymentMethod['icon'] = $icon;
             }
             $paymentMethods[$paymentMethodCode] = $paymentMethod;
         }
     }
     return $paymentMethods;
 }
开发者ID:Adyen,项目名称:adyen-magento2,代码行数:40,代码来源:PaymentMethods.php

示例2: testGetStaticViewFileContext

 public function testGetStaticViewFileContext()
 {
     $this->mockDesign();
     $context = $this->object->getStaticViewFileContext();
     $this->assertInstanceOf('\\Magento\\Framework\\View\\Asset\\ContextInterface', $context);
     $this->assertSame($context, $this->object->getStaticViewFileContext());
     // to ensure in-memory caching
     $asset = $this->object->createAsset('test/file.js');
     $this->assertSame($context, $asset->getContext());
     // and once again to ensure in-memory caching for real
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:11,代码来源:RepositoryTest.php

示例3: createAsset

 /**
  * Create a file asset that's subject of fallback system
  *
  * @param string $fileId
  * @param array $params
  * @return \Magento\Framework\View\Asset\File
  */
 public function createAsset($fileId, array $params = [])
 {
     $params = array_merge(['_secure' => $this->_request->isSecure()], $params);
     return $this->_assetRepo->createAsset($fileId, $params);
 }
开发者ID:Adyen,项目名称:adyen-magento2,代码行数:12,代码来源:Data.php


注:本文中的Repository::createAsset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。