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


PHP type::getValue方法代码示例

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


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

示例1: doAddFavoriteSphone

 /**
  * Add product to authenticated user's favorites. (for Smart phone)
  *
  * @param type $objCustomer 
  * @return void
  */
 function doAddFavoriteSphone($objCustomer)
 {
     // ログイン中のユーザが商品をお気に入りにいれる処理(スマートフォン用)
     if ($objCustomer->isLoginSuccess() === true && $this->objFormParam->getValue('favorite_product_id') > 0) {
         $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam);
         if (count($this->arrErr) == 0) {
             if ($this->lfRegistFavoriteProduct($this->objFormParam->getValue('favorite_product_id'), $objCustomer->getValue('customer_id'))) {
                 $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
                 $objPlugin->doAction('LC_Page_Products_Detail_action_add_favorite_sphone', array($this));
                 print 'true';
                 SC_Response_Ex::actionExit();
             }
         }
         print 'error';
         SC_Response_Ex::actionExit();
     }
 }
开发者ID:Rise-Up-Cambodia,项目名称:Rise-Up,代码行数:23,代码来源:LC_Page_Products_Detail.php

示例2: sanitizePhone

 /**
  *
  * @param type $phone
  * @return type
  */
 public static function sanitizePhone($phone)
 {
     $num = preg_replace("/[^0-9]/", "", $phone->getValue());
     return intval(substr($num, strlen($num) - 9, 9));
 }
开发者ID:kathynka,项目名称:Foundation,代码行数:10,代码来源:Filter.php

示例3: validateField

 /**
  * Bulk PHP validation.
  *
  * @param type $field Field class instance
  * @param type $value
  * @return \WP_Error|boolean
  * @throws Exception
  */
 public function validateField($field)
 {
     $value = apply_filters('wptoolset_validation_value_' . $field->getType(), $field->getValue());
     $rules = $this->_parseRules($field->getValidationData(), $value);
     // If not required but empty - skip
     if (!isset($rules['required']) && (is_null($value) || $value === false || $value === '')) {
         return true;
     }
     try {
         $errors = array();
         foreach ($rules as $rule => $args) {
             if (!$this->validate($rule, $args['args'])) {
                 $errors[] = $field->getTitle() . ' ' . $args['message'];
             }
         }
         if (!empty($errors)) {
             throw new Exception();
         }
     } catch (Exception $e) {
         return new WP_Error(__CLASS__ . '::' . __METHOD__, 'Field not validated', $errors);
     }
     return true;
 }
开发者ID:SpencerNeitzke,项目名称:types,代码行数:31,代码来源:class.validation.php

示例4: validateField

 /**
  * Bulk PHP validation.
  * 
  * @param type $field Field class instance
  * @param type $value
  * @return \WP_Error|boolean
  * @throws Exception
  */
 public function validateField($field)
 {
     $rules = $field->getValidationData();
     $value = apply_filters('wptoolset_validation_value_' . $field->getType(), $field->getValue());
     // If not required but empty - skip
     if (!isset($rules['required']) && (is_null($value) || $value === false || $value === '')) {
         return true;
     }
     try {
         $errors = array();
         foreach ($rules as $rule => $args) {
             $rule = apply_filters('wptoolset_validation_rule_php', $rule);
             $args['args'] = apply_filters('wptoolset_validation_args_php', $args['args'], $rule);
             // Set value in args - search string '$value' or replace first element
             $replace = array_search('$value', $args['args']);
             if ($replace !== false) {
                 $args['args'][$replace] = $value;
             } else {
                 $args['args'][0] = $value;
             }
             if (!$this->validate($rule, $args['args'])) {
                 $errors[] = $args['message'];
             }
         }
         if (!empty($errors)) {
             throw new Exception();
         }
     } catch (Exception $e) {
         return new WP_Error(__CLASS__ . '::' . __METHOD__, 'Field not validated', $errors);
     }
     return true;
 }
开发者ID:javierdlahoz,项目名称:paella-development,代码行数:40,代码来源:class.validation.php

示例5: simpleMatchSetTagLabel

 /**
  * add the simpleAssociableChoiceTag.
  *
  *
  * @param type $label
  * @param type $numberLabel
  * @param type $elementLabel
  */
 protected function simpleMatchSetTagLabel($label, $numberLabel, $elementLabel)
 {
     if ($this->cardinality == 'multiple') {
         $w = 0;
         foreach ($this->interactionmatching->getProposals() as $pr) {
             ++$w;
         }
         $maxAssociation = $w;
     } else {
         $maxAssociation = 1;
     }
     if ($label->getPositionForce() == 1) {
         $positionForced = 'true';
     } else {
         $positionForced = 'false';
     }
     $simpleLabel = $this->document->CreateElement('simpleAssociableChoice');
     $simpleLabel->setAttribute('identifier', 'right' . $numberLabel);
     $simpleLabel->setAttribute('fixed', $positionForced);
     $simpleLabel->setAttribute('matchMax', $maxAssociation);
     $this->matchInteraction->appendChild($simpleLabel);
     $this->getDomEl($simpleLabel, $label->getValue());
     $elementLabel->appendChild($simpleLabel);
     if ($label->getFeedback() != null && $label->getFeedback() != '') {
         $feedbackInline = $this->document->CreateElement('feedbackInline');
         $feedbackInline->setAttribute('outcomeIdentifier', 'FEEDBACK');
         $feedbackInline->setAttribute('identifier', 'Choice' . $numberLabel);
         $feedbackInline->setAttribute('showHide', 'show');
         $this->getDomEl($feedbackInline, $label->getFeedback());
         $simpleLabel->appendChild($feedbackInline);
     }
 }
开发者ID:claroline,项目名称:distribution,代码行数:40,代码来源:MatchingExport.php

示例6: validateField

 /**
  * Bulk PHP validation.
  *
  * @param type $field Field class instance
  * @param type $value
  * @return \WP_Error|boolean
  * @throws Exception
  */
 public function validateField($field)
 {
     $value = apply_filters('wptoolset_validation_value_' . $field->getType(), $field->getValue());
     $rules = $this->_parseRules($field->getValidationData(), $value);
     // If not required but empty - skip
     if (!isset($rules['required']) && (is_null($value) || $value === false || $value === '')) {
         return true;
     }
     try {
         $errors = array();
         foreach ($rules as $rule => $args) {
             if (!$this->validate($rule, $args['args'])) {
                 /**
                  * Allow turn off field name.
                  *
                  * Allow turn off field name from error message.
                  *
                  * @since x.x.x
                  *
                  * @param boolean $var show field title in message, * default true.
                  */
                 if (apply_filters('toolset_common_validation_add_field_name_to_error', true)) {
                     $errors[] = $field->getTitle() . ' ' . $args['message'];
                 } else {
                     $errors[] = $args['message'];
                 }
             }
         }
         if (!empty($errors)) {
             throw new Exception();
         }
     } catch (Exception $e) {
         return new WP_Error(__CLASS__ . '::' . __METHOD__, 'Field not validated', $errors);
     }
     return true;
 }
开发者ID:aarongillett,项目名称:B22-151217,代码行数:44,代码来源:class.validation.php

示例7: simpleMatchSetTagLabel

 /**
  * add the simpleAssociableChoiceTag
  *
  * @access protected
  *
  * @param type $label
  * @param type $numberLabel
  * @param type $elementLabel
  */
 protected function simpleMatchSetTagLabel($label, $numberLabel, $elementLabel)
 {
     if ($this->cardinality == "multiple") {
         $w = 0;
         foreach ($this->interactionmatching->getProposals() as $pr) {
             $w++;
         }
         $maxAssociation = $w;
     } else {
         $maxAssociation = 1;
     }
     if ($label->getPositionForce() == 1) {
         $positionForced = 'true';
     } else {
         $positionForced = 'false';
     }
     $simpleLabel = $this->document->CreateElement('simpleAssociableChoice');
     $simpleLabel->setAttribute("identifier", "right" . $numberLabel);
     $simpleLabel->setAttribute("fixed", $positionForced);
     $simpleLabel->setAttribute("matchMax", $maxAssociation);
     $this->matchInteraction->appendChild($simpleLabel);
     $simpleLabeltxt = $this->document->CreateTextNode($label->getValue());
     $simpleLabel->appendChild($simpleLabeltxt);
     $elementLabel->appendChild($simpleLabel);
     if ($label->getFeedback() != Null && $label->getFeedback() != "") {
         $feedbackInline = $this->document->CreateElement('feedbackInline');
         $feedbackInline->setAttribute("outcomeIdentifier", "FEEDBACK");
         $feedbackInline->setAttribute("identifier", "Choice" . $numberLabel);
         $feedbackInline->setAttribute("showHide", "show");
         $feedbackInlinetxt = $this->document->CreateTextNode($label->getFeedback());
         $feedbackInline->appendChild($feedbackInlinetxt);
         $simpleLabel->appendChild($feedbackInline);
     }
 }
开发者ID:pitrackster,项目名称:ExoBundle,代码行数:43,代码来源:matchingExport.php


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