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


PHP ObjectModel::validateFieldsLang方法代码示例

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


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

示例1: getTranslationsFieldsChild

 /**
  * Check then return multilingual fields for database interaction
  *
  * @return array Multilingual fields
  */
 public function getTranslationsFieldsChild()
 {
     parent::validateFieldsLang();
     $fieldsArray = array('title', 'url');
     $fields = array();
     $languages = Language::getLanguages(false);
     $defaultLanguage = (int) Configuration::get('PS_LANG_DEFAULT');
     foreach ($languages as $language) {
         $fields[$language['id_lang']]['id_lang'] = (int) $language['id_lang'];
         $fields[$language['id_lang']][self::$definition['primary']] = (int) $this->id;
         foreach ($fieldsArray as $field) {
             if (!Validate::isTableOrIdentifier($field)) {
                 die(Tools::displayError());
             }
             if (isset($this->{$field}[$language['id_lang']]) and !empty($this->{$field}[$language['id_lang']])) {
                 $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']], true);
             } elseif (in_array($field, $this->fieldsRequiredLang)) {
                 $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage], true);
             } else {
                 $fields[$language['id_lang']][$field] = '';
             }
         }
     }
     return $fields;
 }
开发者ID:arozanski,项目名称:simpleresponsivetheme,代码行数:30,代码来源:ResponsiveLinksClass.php

示例2: getTranslationsFieldsChild

 public function getTranslationsFieldsChild()
 {
     if (!parent::validateFieldsLang()) {
         return false;
     }
     return parent::getTranslationsFields(array('name'));
 }
开发者ID:Bruno-2M,项目名称:prestashop,代码行数:7,代码来源:Group.php

示例3: getTranslationsFieldsChild

 /**
  * Check then return multilingual fields for database interaction
  *
  * @return array Multilingual fields
  */
 public function getTranslationsFieldsChild()
 {
     parent::validateFieldsLang();
     $fieldsArray = array('name', 'link');
     $fields = array();
     $languages = Language::getLanguages(false);
     $defaultLanguage = Configuration::get('PS_LANG_DEFAULT');
     foreach ($languages as $language) {
         $fields[$language['id_lang']]['id_lang'] = $language['id_lang'];
         $fields[$language['id_lang']][$this->identifier] = intval($this->id);
         $fields[$language['id_lang']]['value_over'] = isset($this->value_over[$language['id_lang']]) ? pSQL($this->value_over[$language['id_lang']], true) : '';
         $fields[$language['id_lang']]['value_under'] = isset($this->value_under[$language['id_lang']]) ? pSQL($this->value_under[$language['id_lang']], true) : '';
         foreach ($fieldsArray as $field) {
             if (!Validate::isTableOrIdentifier($field)) {
                 die(Tools::displayError());
             }
             /* Check fields validity */
             if (isset($this->{$field}[$language['id_lang']]) and !empty($this->{$field}[$language['id_lang']])) {
                 $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']]);
             } elseif (in_array($field, $this->fieldsRequiredLang)) {
                 $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage]);
             } else {
                 $fields[$language['id_lang']][$field] = '';
             }
         }
     }
     return $fields;
     return parent::getTranslationsFields(array('name', 'link'));
 }
开发者ID:TheTypoMaster,项目名称:neonflexible,代码行数:34,代码来源:AdvancedTopMenuColumnClass.php

示例4: getTranslationsFieldsChild

 public function getTranslationsFieldsChild()
 {
     parent::validateFieldsLang();
     $fieldsArray = array('meta_title', 'meta_description', 'meta_keywords', 'link_rewrite');
     $fields = array();
     $languages = Language::getLanguages(false);
     $defaultLanguage = (int) Configuration::get('PS_LANG_DEFAULT');
     foreach ($languages as $language) {
         $fields[$language['id_lang']]['id_lang'] = (int) $language['id_lang'];
         $fields[$language['id_lang']][$this->identifier] = (int) $this->id;
         $fields[$language['id_lang']]['content'] = isset($this->content[$language['id_lang']]) ? pSQL($this->content[$language['id_lang']], true) : '';
         foreach ($fieldsArray as $field) {
             if (!Validate::isTableOrIdentifier($field)) {
                 die(Tools::displayError());
             }
             if (isset($this->{$field}[$language['id_lang']]) and !empty($this->{$field}[$language['id_lang']])) {
                 $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']]);
             } elseif (in_array($field, $this->fieldsRequiredLang)) {
                 $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage]);
             } else {
                 $fields[$language['id_lang']][$field] = '';
             }
         }
     }
     return $fields;
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:26,代码来源:CMS.php

示例5: getTranslationsFieldsChild

 /**
  * Check then return multilingual fields for database interaction
  *
  * @return array Multilingual fields
  */
 public function getTranslationsFieldsChild()
 {
     if (!is_array($this->value)) {
         return true;
     }
     parent::validateFieldsLang();
     return parent::getTranslationsFields(array('value'));
 }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:13,代码来源:Configuration.php

示例6: getTranslationsFieldsChild

 /**
  * Check then return multilingual fields for database interaction
  *
  * @return array Multilingual fields
  */
 public function getTranslationsFieldsChild()
 {
     parent::validateFieldsLang();
     $fields = array();
     $languages = Language::getLanguages(false);
     $defaultLanguage = Configuration::get('PS_LANG_DEFAULT');
     foreach ($languages as $language) {
         $fields[$language['id_lang']]['id_lang'] = $language['id_lang'];
         $fields[$language['id_lang']][$this->identifier] = intval($this->id);
         $fields[$language['id_lang']]['value_over'] = isset($this->value_over[$language['id_lang']]) ? pSQL($this->value_over[$language['id_lang']], true) : '';
         $fields[$language['id_lang']]['value_under'] = isset($this->value_under[$language['id_lang']]) ? pSQL($this->value_under[$language['id_lang']], true) : '';
     }
     return $fields;
 }
开发者ID:TheTypoMaster,项目名称:neonflexible,代码行数:19,代码来源:AdvancedTopMenuColumnWrapClass.php

示例7: getTranslationsFieldsChild

 public function getTranslationsFieldsChild()
 {
     parent::validateFieldsLang();
     $fieldsArray = array('meta_title', 'meta_description', 'title', 'seo_url', 'meta_keywords');
     $fields = array();
     $languages = Language::getLanguages(false);
     $defaultLanguage = Configuration::get('PS_LANG_DEFAULT');
     foreach ($languages as $language) {
         $fields[$language['id_lang']]['id_lang'] = $language['id_lang'];
         $fields[$language['id_lang']][$this->identifier] = intval($this->id);
         $fields[$language['id_lang']]['description'] = (isset($this->description[$language['id_lang']]) and !empty($this->description[$language['id_lang']])) ? pSQL($this->description[$language['id_lang']], true) : pSQL($this->description[$defaultLanguage], true);
         foreach ($fieldsArray as $field) {
             if (!Validate::isTableOrIdentifier($field)) {
                 die(Tools::displayError());
             }
             if (isset($this->{$field}[$language['id_lang']]) and !empty($this->{$field}[$language['id_lang']])) {
                 $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']]);
             } else {
                 $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage]);
             }
         }
     }
     return $fields;
 }
开发者ID:acreno,项目名称:pm-ps,代码行数:24,代码来源:AdvancedSearchSeoClass.php

示例8: getTranslationsFieldsChild

 public function getTranslationsFieldsChild()
 {
     parent::validateFieldsLang();
     return parent::getTranslationsFields(array('description', 'meta_title', 'meta_keywords', 'meta_description'));
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:5,代码来源:Supplier.php

示例9: validateFieldsLang

 public function validateFieldsLang($die = true, $errorReturn = false)
 {
     $limit = (int) Configuration::get('PS_PRODUCT_SHORT_DESC_LIMIT');
     if ($limit <= 0) {
         $limit = 800;
     }
     if (!is_array($this->description_short)) {
         $this->description_short = array();
     }
     foreach ($this->description_short as $k => $value) {
         if (Tools::strlen(strip_tags($value)) > $limit) {
             if ($die) {
                 die(Tools::displayError() . ' (' . get_class($this) . '->description_short: length > ' . $limit . ' for language ' . $k . ')');
             }
             return $errorReturn ? get_class($this) . '->' . Tools::displayError('description_short: length >') . ' ' . $limit . ' ' . Tools::displayError('for language') . ' ' . $k : false;
         }
     }
     return parent::validateFieldsLang($die, $errorReturn);
 }
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:19,代码来源:Product.php

示例10: getTranslationsFieldsChild

 public function getTranslationsFieldsChild()
 {
     parent::validateFieldsLang();
     return parent::getTranslationsFields(array('category_name', 'category_description', 'category_meta_title', 'category_meta_description', 'category_meta_keywords', 'link_rewrite'));
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:5,代码来源:CategoryObject.php

示例11: validateFieldsLang

 public function validateFieldsLang($die = true, $errorReturn = false)
 {
     if (!is_array($this->description_short)) {
         $this->description_short = array();
     }
     foreach ($this->description_short as $k => $value) {
         if (Tools::strlen(strip_tags($value)) > 4000) {
             if ($die) {
                 die(Tools::displayError() . ' (' . get_class($this) . '->description: length > 4000 for language ' . $k . ')');
             }
             return $errorReturn ? get_class($this) . '->' . Tools::displayError('description: length > 4000 for language') . ' ' . $k : false;
         }
     }
     return parent::validateFieldsLang($die, $errorReturn);
 }
开发者ID:priyankajsr19,项目名称:shalu,代码行数:15,代码来源:Product.php

示例12: validateFieldsLang

 /**
  * @see ObjectModel::validateFieldsLang()
  */
 public function validateFieldsLang($die = true, $error_return = false)
 {
     $limit = (int) Configuration::get('PS_PRODUCT_SHORT_DESC_LIMIT');
     if ($limit <= 0) {
         $limit = 800;
     }
     $this->def['fields']['description_short']['size'] = $limit;
     return parent::validateFieldsLang($die, $error_return);
 }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:12,代码来源:Product.php

示例13: getTranslationsFieldsChild

 public function getTranslationsFieldsChild()
 {
     parent::validateFieldsLang();
     return parent::getTranslationsFields(array('tags_name', 'tags_description'));
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:5,代码来源:TagsObject.php

示例14: getTranslationsFieldsChild

 /**
  * Check then return multilingual fields for database interaction
  *
  * @return array Multilingual fields
  */
 public function getTranslationsFieldsChild()
 {
     parent::validateFieldsLang();
     return parent::getTranslationsFields(array('name'));
 }
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:10,代码来源:Country.php

示例15: getTranslationsFieldsChild

 public function getTranslationsFieldsChild()
 {
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         if (count($this->tables) == 1) {
             return;
         }
         parent::validateFieldsLang();
         $fields_array = array();
         $fields = array();
         $definition = $this->getDefinitionProperty();
         if (isset($definition)) {
             foreach ($definition['fields'] as $field_name => $field) {
                 if (is_array($this->{$field_name})) {
                     $fields_array[] = $field_name;
                 }
             }
         }
         foreach (Language::getLanguages(false) as $language) {
             $fields[$language['id_lang']]['id_lang'] = $language['id_lang'];
             $fields[$language['id_lang']][$this->identifier] = (int) $this->{$this->identifier};
             foreach ($fields_array as $field) {
                 if (!Validate::isTableOrIdentifier($field)) {
                     die(Tools::displayError());
                 }
                 if (isset($this->{$field}[$language['id_lang']]) && !empty($this->{$field}[$language['id_lang']])) {
                     $fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']]);
                 } elseif (in_array($field, $this->fieldsRequiredLang)) {
                     if ($this->{$field} != '') {
                         $fields[$language['id_lang']][$field] = pSQL($this->{$field}[(int) _PS_LANG_DEFAULT_]);
                     }
                 } else {
                     $fields[$language['id_lang']][$field] = '';
                 }
             }
         }
         return $fields;
     } else {
         $this->validateFieldsLang();
         $is_lang_multishop = $this->isLangMultishop();
         $fields = array();
         if ($this->id_lang === null) {
             foreach (Language::getLanguages(false) as $language) {
                 $fields[$language['id_lang']] = $this->formatFields(self::FORMAT_LANG, $language['id_lang']);
                 $fields[$language['id_lang']]['id_lang'] = $language['id_lang'];
                 if ($this->id_shop && $is_lang_multishop) {
                     $fields[$language['id_lang']]['id_shop'] = (int) $this->id_shop;
                 }
             }
         } else {
             $fields = array($this->id_lang => $this->formatFields(self::FORMAT_LANG, $this->id_lang));
             $fields[$this->id_lang]['id_lang'] = $this->id_lang;
             if ($this->id_shop && $is_lang_multishop) {
                 $fields[$this->id_lang]['id_shop'] = (int) $this->id_shop;
             }
         }
         return $fields;
     }
 }
开发者ID:ventsiwad,项目名称:presta_addons,代码行数:58,代码来源:ObjectModel.php


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