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


PHP AdminTab::copyFromPost方法代码示例

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


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

示例1: copyFromPost

 protected function copyFromPost(&$object, $table)
 {
     parent::copyFromPost($object, $table);
     if (get_class($object) != 'Product') {
         return;
     }
     /* Additional fields */
     $languages = Language::getLanguages();
     foreach ($languages as $language) {
         if (isset($_POST['meta_keywords_' . $language['id_lang']])) {
             $_POST['meta_keywords_' . $language['id_lang']] = preg_replace('/ *,? +,*/', ',', strtolower($_POST['meta_keywords_' . $language['id_lang']]));
         }
     }
     $_POST['weight'] = empty($_POST['weight']) ? '0' : str_replace(',', '.', $_POST['weight']);
     if ($_POST['reduction_price'] != NULL) {
         $object->reduction_price = str_replace(',', '.', $_POST['reduction_price']);
     }
     if ($_POST['reduction_percent'] != NULL) {
         $object->reduction_percent = str_replace(',', '.', $_POST['reduction_percent']);
     }
     if ($_POST['ecotax'] != NULL) {
         $object->ecotax = str_replace(',', '.', $_POST['ecotax']);
     }
     $object->active = (!isset($_POST['active']) or $_POST['active']) ? true : false;
     $object->on_sale = !isset($_POST['on_sale']) ? false : true;
 }
开发者ID:raulgimenez,项目名称:dreamongraphics_shop,代码行数:26,代码来源:AdminProducts.php

示例2: copyFromPost

 protected function copyFromPost(&$object, $table)
 {
     parent::copyFromPost($object, $table);
     if (get_class($object) != 'Product') {
         return;
     }
     /* Additional fields */
     $languages = Language::getLanguages(false);
     foreach ($languages as $language) {
         if (isset($_POST['meta_keywords_' . $language['id_lang']])) {
             $_POST['meta_keywords_' . $language['id_lang']] = $this->_cleanMetaKeywords(Tools::strtolower($_POST['meta_keywords_' . $language['id_lang']]));
             // preg_replace('/ *,? +,* /', ',', strtolower($_POST['meta_keywords_'.$language['id_lang']]));
             $object->meta_keywords[$language['id_lang']] = $_POST['meta_keywords_' . $language['id_lang']];
         }
     }
     $_POST['width'] = empty($_POST['width']) ? '0' : str_replace(',', '.', $_POST['width']);
     $_POST['height'] = empty($_POST['height']) ? '0' : str_replace(',', '.', $_POST['height']);
     $_POST['depth'] = empty($_POST['depth']) ? '0' : str_replace(',', '.', $_POST['depth']);
     $_POST['weight'] = empty($_POST['weight']) ? '0' : str_replace(',', '.', $_POST['weight']);
     if ($_POST['unit_price'] != NULL) {
         $object->unit_price = str_replace(',', '.', $_POST['unit_price']);
     }
     if (array_key_exists('ecotax', $_POST) && $_POST['ecotax'] != NULL) {
         $object->ecotax = str_replace(',', '.', $_POST['ecotax']);
     }
     $object->available_for_order = (int) Tools::isSubmit('available_for_order');
     $object->show_price = $object->available_for_order ? 1 : (int) Tools::isSubmit('show_price');
     $object->on_sale = Tools::isSubmit('on_sale');
     $object->online_only = Tools::isSubmit('online_only');
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:30,代码来源:AdminProducts.php

示例3: copyFromPost

 protected function copyFromPost(&$object, $table)
 {
     parent::copyFromPost($object, $table);
     $object->cumulable = !isset($_POST['cumulable']) ? false : true;
     $object->cumulable_reduction = !isset($_POST['cumulable_reduction']) ? false : true;
 }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:6,代码来源:AdminDiscounts.php

示例4: copyFromPost

 protected function copyFromPost(&$object, $table)
 {
     if ($object->id and $object->iso_code != $_POST['iso_code']) {
         if (Validate::isLanguageIsoCode($_POST['iso_code'])) {
             $object->moveToIso($_POST['iso_code']);
         }
     }
     parent::copyFromPost($object, $table);
 }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:9,代码来源:AdminLanguages.php


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