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


PHP Feature::getFeature方法代码示例

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


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

示例1: checkFeatures

 private function checkFeatures($languages, $feature_id)
 {
     $rules = call_user_func(array('FeatureValue', 'getValidationRules'), 'FeatureValue');
     $feature = Feature::getFeature(Configuration::get('PS_LANG_DEFAULT'), $feature_id);
     $val = 0;
     foreach ($languages as $language) {
         if ($val = Tools::getValue('custom_' . $feature_id . '_' . $language['id_lang'])) {
             $currentLanguage = new Language($language['id_lang']);
             if (Tools::strlen($val) > $rules['sizeLang']['value']) {
                 $this->_errors[] = Tools::displayError('name for feature') . ' <b>' . $feature['name'] . '</b> ' . Tools::displayError('is too long in') . ' ' . $currentLanguage->name;
             } elseif (!call_user_func(array('Validate', $rules['validateLang']['value']), $val)) {
                 $this->_errors[] = Tools::displayError('valid name required for feature') . ' <b>' . $feature['name'] . '</b> ' . Tools::displayError('in') . ' ' . $currentLanguage->name;
             }
             if (sizeof($this->_errors)) {
                 return 0;
             }
             // Getting default language
             if ($language['id_lang'] == Configuration::get('PS_LANG_DEFAULT')) {
                 return $val;
             }
         }
     }
     return 0;
 }
开发者ID:raulgimenez,项目名称:dreamongraphics_shop,代码行数:24,代码来源:AdminProducts.php

示例2: getFeatures

 function getFeatures($prod_id)
 {
     $features = Product::getFeaturesStatic((int) $prod_id);
     $params = array();
     foreach ($features as $feature) {
         $feature_name = Feature::getFeature($this->id_lang, $feature['id_feature']);
         $feature_name = $feature_name['name'];
         $feature_values = FeatureValue::getFeatureValueLang($feature['id_feature_value']);
         $feature_value = null;
         foreach ($feature_values as $f_value) {
             $feature_value = $f_value['value'];
             if ($f_value['id_lang'] == $this->id_lang) {
                 break;
             }
         }
         if ($feature_value != null) {
             $params[$feature_name] = $feature_value;
         }
     }
     return $params;
 }
开发者ID:WhisperingTree,项目名称:etagerca,代码行数:21,代码来源:topshop.php

示例3: checkFeatures

 protected function checkFeatures($languages, $feature_id)
 {
     ${"GLOBALS"}["vwodjfq"] = "language";
     $qfnuwmyd = "languages";
     $ibpoyg = "rules";
     ${$ibpoyg} = call_user_func(array("FeatureValue", "getValidationRules"), "FeatureValue");
     ${${"GLOBALS"}["betiltspyoh"]} = Feature::getFeature((int) Configuration::get("PS_LANG_DEFAULT"), ${${"GLOBALS"}["mwwcbwcjpxr"]});
     ${${"GLOBALS"}["thcmvewqwmi"]} = 0;
     foreach (${$qfnuwmyd} as ${${"GLOBALS"}["vwodjfq"]}) {
         $pjoupqzlsl = "val";
         $pkiwyhvqtt = "language";
         if (${$pjoupqzlsl} = Tools::getValue("custom_" . ${${"GLOBALS"}["mwwcbwcjpxr"]} . "_" . ${$pkiwyhvqtt}["id_lang"])) {
             ${"GLOBALS"}["mykyiyt"] = "rules";
             ${"GLOBALS"}["tctdekzczeh"] = "language";
             $vgqdyjbz = "feature";
             ${"GLOBALS"}["xejrwuzpgjoq"] = "rules";
             ${"GLOBALS"}["gcefqggmt"] = "feature";
             ${${"GLOBALS"}["rypgtcc"]} = new Language(${${"GLOBALS"}["tctdekzczeh"]}["id_lang"]);
             if (Tools::strlen(${${"GLOBALS"}["thcmvewqwmi"]}) > ${${"GLOBALS"}["xejrwuzpgjoq"]}["sizeLang"]["value"]) {
                 $this->errors[] = Tools::displayError("name for feature") . " <b>" . ${${"GLOBALS"}["gcefqggmt"]}["name"] . "</b> " . Tools::displayError("is too long in") . " " . $current_language->name;
             } elseif (!call_user_func(array("Validate", ${${"GLOBALS"}["mykyiyt"]}["validateLang"]["value"]), ${${"GLOBALS"}["thcmvewqwmi"]})) {
                 $this->errors[] = Tools::displayError("Valid name required for feature.") . " <b>" . ${$vgqdyjbz}["name"] . "</b> " . Tools::displayError("in") . " " . $current_language->name;
             }
             $iigbsri = "language";
             ${"GLOBALS"}["izxppmnrzn"] = "val";
             if (count($this->errors)) {
                 return 0;
             }
             if (${$iigbsri}["id_lang"] == Configuration::get("PS_LANG_DEFAULT")) {
                 return ${${"GLOBALS"}["izxppmnrzn"]};
             }
         }
     }
     return 0;
 }
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:35,代码来源:sellerproductdetailbase.php


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