當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Gpf_Rpc_Form::addValidator方法代碼示例

本文整理匯總了PHP中Gpf_Rpc_Form::addValidator方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gpf_Rpc_Form::addValidator方法的具體用法?PHP Gpf_Rpc_Form::addValidator怎麽用?PHP Gpf_Rpc_Form::addValidator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gpf_Rpc_Form的用法示例。


在下文中一共展示了Gpf_Rpc_Form::addValidator方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 /**
  * @anonym
  * @service custom_separator write
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Form
  */
 public function save(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), self::COMMISSION_KEY);
     $form->addValidator(new Gpf_Rpc_Form_Validator_NumberRangeValidator(0, 100), self::COMMISSION_KEY);
     $form->validate();
     if($form->isSuccessful()){
         Gpf_Settings::set(self::COMMISSION_KEY, $form->getFieldValue(self::COMMISSION_KEY));
         $form->setInfoMessage($this->_('Plugin configuration saved'));
     }
     return $form;
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:17,代碼來源:Config.class.php

示例2: execute

 protected function execute(Gpf_Rpc_Params $params)
 {
     $form = new Gpf_Rpc_Form($params);
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Gpf_Install_CreateDatabase::DB_HOSTNAME, $this->_('Database Hostname'));
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Gpf_Install_CreateDatabase::DB_USERNAME, $this->_('Username'));
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Gpf_Install_CreateDatabase::DB_NAME, $this->_('Database Name'));
     if (!$form->validate()) {
         return $form;
     }
     $createDatabaseTask = new Gpf_Install_CreateDatabaseTask();
     $createDatabaseTask->setDBSettings($form->getFieldValue(Gpf_Install_CreateDatabase::DB_HOSTNAME), $form->getFieldValue(Gpf_Install_CreateDatabase::DB_USERNAME), $form->getFieldValue(Gpf_Install_CreateDatabase::DB_NAME), $form->getFieldValue(Gpf_Install_CreateDatabase::DB_PASSWORD));
     try {
         $createDatabaseTask->run();
     } catch (Gpf_Tasks_LongTaskInterrupt $e) {
         $this->setResponseType($form, self::PART_DONE_TYPE);
         $form->setInfoMessage($e->getMessage());
         return $form;
     } catch (Exception $e) {
         $form->setErrorMessage($e->getMessage());
         return $form;
     }
     $this->setNextStep($form);
     return $form;
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:24,代碼來源:CreateDatabase.class.php

示例3: initValidators

	public function initValidators(Gpf_Rpc_Form $form) {
		if (!($form->existsField('isdesign') && $form->getFieldValue('isdesign') == Gpf::YES)) {
			$form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::NAME, $this->_('name'));
			$form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::STATUS, $this->_('status'));
			$form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::SIZE, $this->_('size'));
			$form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::DATA1, $this->_('description'));
			$form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::DATA2, $this->_('maximum coupons per affiliate'));
			$form->addValidator(new Gpf_Rpc_Form_Validator_IntegerNumberPositiveValidator(), Pap_Db_Table_Banners::DATA2);
		}
	}
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:10,代碼來源:Coupon.class.php

示例4: setValidators

 private function setValidators($type) {
     if($this->form->getFieldValue("unlimitedValidity") == Gpf::YES) {
         $this->form->setField('validto', '2030-12-30');
     }
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_IntegerNumberPositiveValidator(), self::MAX_USE_COUNT, $this->_('Limit use'));
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), self::MAX_USE_COUNT);
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_DateValidator(), self::VALID_FROM, $this->_('Valid from'));
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), self::VALID_FROM);
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_DateValidator(), self::VALID_TO, $this->_('Valid to'));
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), self::VALID_TO);
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), self::COUPON_ASSIGMENT, $this->_('Coupon assigment'));
     if ($this->form->getFieldValue(self::COUPON_ASSIGMENT) == 'A') {
         $this->form->addValidator(new Gpf_Rpc_Form_Validator_IntegerNumberPositiveValidator(), self::COUPONS_PER_AFF, $this->_('Coupons to each affiliate'));
         $this->form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), self::COUPONS_PER_AFF);
     }
     if ($type == self::IMPORT) {
         $this->form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), self::COUPONS_CODES, $this->_('Coupon codes'));
         return;
     }
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_RegExpValidator('/^([^{},]*({[zZ9X]+})+[^{},]*)+$/', $this->_('Enter valid %s')), self::COUPON_FORMAT, $this->_('Coupon format'));
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), self::COUPON_FORMAT);
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_IntegerNumberPositiveValidator(), self::COUPONS_COUNT, $this->_('Number of coupons'));
     $this->form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), self::COUPONS_COUNT);
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:24,代碼來源:CreateCoupons.class.php

示例5: initValidators

 public function initValidators(Gpf_Rpc_Form $form)
 {
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::NAME, $this->_('name'));
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::STATUS, $this->_('status'));
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::SIZE, $this->_('size'));
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), Pap_Db_Table_Banners::DESTINATION_URL, $this->_('destination url'));
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:7,代碼來源:Impression.php

示例6: setValidators

 private function setValidators(Gpf_Rpc_Form $form) {
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), 'totalcost', $this->_('Total cost'));
     $form->addValidator(new Gpf_Rpc_Form_Validator_NumberValidator(), 'totalcost');
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), 'orderid', $this->_('Order ID'));
     $form->addValidator(new Gpf_Rpc_Form_Validator_MandatoryValidator(), 'productid', $this->_('Product ID'));
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:6,代碼來源:OfflineSaleForm.class.php

示例7: initValidators

 private function initValidators(Gpf_Rpc_Form $form) {
     $form->addValidator(new Pap_Merchants_Config_AutoDeleteWithRepeatingClicksValidator($form), Pap_Settings::REPEATING_CLICKS_SECONDS_SETTING_NAME, '');
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:3,代碼來源:FraudprotectionClicksForm.class.php

示例8: initValidators

 private function initValidators(Gpf_Rpc_Form $form) {
     $form->addValidator(new Pap_Merchants_Config_TrackingAutoDeleteWithIpValidityValidator($form), Pap_Settings::AUTO_DELETE_RAWCLICKS);
     $form->addValidator(new Pap_Merchants_Config_TrackingAutoDeleteWithRepeatingClicksValidator($form), Pap_Settings::AUTO_DELETE_RAWCLICKS);
 }
開發者ID:AmineCherrai,項目名稱:rostanvo,代碼行數:4,代碼來源:TrackingForm.class.php


注:本文中的Gpf_Rpc_Form::addValidator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。