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


PHP FieldList::exists方法代码示例

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


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

示例1: getFormFields

 /**
  * Add shipping region code dropdown to form.
  * @return FieldList
  */
 public function getFormFields()
 {
     $fields = new FieldList();
     if ($shippingRegion = $this->Region()) {
         $field = new StreakRegionShippingModifierField($this, $this->Description, $shippingRegion->ID);
         /** @var Price $price */
         $price = Price::create();
         $price->setAmount($this->Price);
         $field->setAmount($price);
         $fields->push($field);
     }
     if (!$fields->exists()) {
         Requirements::javascript('swipestreak-regionalshipping/javascript/RegionalShippingModifierField.js');
     }
     return $fields;
 }
开发者ID:swipestreak,项目名称:regionalshipping,代码行数:20,代码来源:Modification.php

示例2: getFormFields

 /**
  * Get the form fields for the OrderForm.
  * 
  * @return FieldList List of fields
  */
 public function getFormFields()
 {
     $fields = new FieldList();
     $field = new XeroTaxModifierField($this, _t('Xero.TAX', 'Tax'));
     $shopConfig = ShopConfig::current_shop_config();
     $amount = new Price();
     $amount->setAmount($this->Price);
     $amount->setCurrency($shopConfig->BaseCurrency);
     $amount->setSymbol($shopConfig->BaseCurrencySymbol);
     $field->setAmount($amount);
     $fields->push($field);
     if (!$fields->exists()) {
         Requirements::javascript('swipestripe-flatfeetax/javascript/FlatFeeTaxModifierField.js');
     }
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:swipestripe-swipestripe-xero,代码行数:21,代码来源:XeroTaxModification.php

示例3: getFormFields

 public function getFormFields()
 {
     $fields = new FieldList();
     $rate = $this->FlatFeeTaxRate();
     $countryID = $rate && $rate->exists() ? $rate->CountryID : null;
     $rates = $countryID ? $rates = FlatFeeTaxRate::get()->where("\"CountryID\" = '{$countryID}'") : null;
     if ($rates && $rates->exists()) {
         $field = new FlatFeeTaxModifierField($this, $rate->Label(), $rate->ID);
         //Set the amount for display on the Order form
         $field->setAmount($rate->Price($this->Order()));
         $fields->push($field);
     }
     if (!$fields->exists()) {
         Requirements::javascript('swipestripe-flatfeetax/javascript/FlatFeeTaxModifierField.js');
     }
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:swipestripe-swipestripe-flatfeetax,代码行数:17,代码来源:FlatFeeTaxModification.php

示例4: getFormFields

 public function getFormFields()
 {
     $fields = new FieldList();
     $rate = $this->FlatFeeShippingRate();
     $rates = $this->getFlatShippingRates($rate->Country());
     if ($rates && $rates->exists()) {
         if ($rates->count() > 1) {
             $field = FlatFeeShippingModifierField_Multiple::create($this, _t('FlatFeeShippingModification.FIELD_LABEL', 'Shipping'), $rates->map('ID', 'Label')->toArray())->setValue($rate->ID);
         } else {
             $newRate = $rates->first();
             $field = FlatFeeShippingModifierField::create($this, $newRate->Title, $newRate->ID)->setAmount($newRate->Price());
         }
         $fields->push($field);
     }
     if (!$fields->exists()) {
         Requirements::javascript('swipestripe-flatfeeshipping/javascript/FlatFeeShippingModifierField.js');
     }
     return $fields;
 }
开发者ID:helpfulrobot,项目名称:swipestripe-swipestripe-flatfeeshipping,代码行数:19,代码来源:FlatFeeShippingModification.php


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