本文整理汇总了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;
}
示例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;
}
示例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;
}