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


PHP Validator::getData方法代碼示例

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


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

示例1: validate

 /**
  * Validate a given attribute against a rule.
  *
  * @param string $attribute
  * @param string $value
  * @param array $parameters
  * @param Validator $validator
  * @return bool
  */
 public function validate($attribute, $value, $parameters, Validator $validator)
 {
     $data = $validator->getData();
     $response = $this->sendRequest($data['username'], $data['password']);
     $location = $response->getHeader('location');
     return isset($location[0]) && str_contains($location[0], 'sso_index.php');
 }
開發者ID:BePsvPT,項目名稱:CCU-Plus,代碼行數:16,代碼來源:SignUpValidator.php

示例2: validateGreaterThanOther

 /**
  * Validate that the value is greater than another attribute
  *
  * @param string $attribute
  * @param  mixed $value
  * @param  array $parameters
  * @param  Illuminate\Validation\Validator $validator
  * @return boolean
  */
 public function validateGreaterThanOther($attribute, $value, $parameters, Validator $validator)
 {
     // Require at least one parameter
     $this->requireParameterCount(1, $parameters, 'greater_than_other');
     $otherField = $parameters[0];
     $otherValue = $this->getValue($otherField, $validator->getData(), $validator->getFiles());
     return isset($otherValue) && is_numeric($value) && is_numeric($otherValue) && $value >= $otherValue;
 }
開發者ID:esensi,項目名稱:core,代碼行數:17,代碼來源:ComparisionValidator.php

示例3: validateAfterOther

 /**
  * Validate that the date is after another attribute date
  *
  * @param string $attribute
  * @param  mixed $value
  * @param  array $parameters
  * @param  Illuminate\Validation\Validator $validator
  * @return boolean
  */
 public function validateAfterOther($attribute, $value, $parameters, Validator $validator)
 {
     // Require at least one parameter
     $this->requireParameterCount(1, $parameters, 'after_other');
     // Get the other value
     $otherField = $parameters[0];
     $otherValue = $this->getValue($otherField, $validator->getData(), $validator->getFiles());
     // Convert the values to dates if not already
     $value = $this->asDateFromValue($value);
     $otherValue = $this->asDateFromValue($otherValue);
     // Compare that the date is after the other date
     return isset($value) && isset($otherValue) && $value >= $otherValue;
 }
開發者ID:esensi,項目名稱:core,代碼行數:22,代碼來源:DateValidator.php

示例4: guardaDatosContrarecibo

 /**
  * Guarda los datos del contrarecibo incluyendo sus detalles.
  *
  * @access proteced
  * @param  Illuminate\Validation\Validator  $validation
  * @param  integer  $id - ID del proveedor
  * @return Contrarecibo Object
  */
 protected function guardaDatosContrarecibo(\Illuminate\Validation\Validator $validation, $id = 0)
 {
     $contrarecibo = new Contrarecibo();
     $transactions = $contrarecibo->getConnection();
     $data = $validation->getData();
     try {
         $transactions->beginTransaction();
         $contrarecibo->fill(['contrarecibo_folio' => Contrarecibo::folio(), 'contrarecibo_fecha_creado' => date('Y-m-d H-i-s'), 'contrarecibo_fecha_pago' => date('Y-m-d'), 'contrarecibo_proveedor_id' => $id]);
         $contrarecibo->save();
         foreach ($data['factura'] as $facturaId => $uuid) {
             DetalleContrarecibo::create(['detalle_contrarecibo_contrarecibo_id' => $contrarecibo->contrarecibo_id, 'detalle_contrarecibo_factura_id' => $facturaId]);
         }
         $transactions->commit();
     } catch (ErrorException $e) {
         $contrarecibo = null;
         $transactions->rollBack();
         Log::error($e);
     }
     return $contrarecibo;
 }
開發者ID:egalink,項目名稱:proveedores,代碼行數:28,代碼來源:EnvioController.php

示例5: getData

 /**
  * Get the data under validation.
  *
  * @return array
  */
 public function getData()
 {
     return $this->validator->getData();
 }
開發者ID:Kremon,項目名稱:laravel-jsvalidation,代碼行數:9,代碼來源:DelegatedValidator.php

示例6: getValidationRules

 /**
  * @param DocumentInterface $document
  * @param Validator         $validator
  *
  * @return array
  */
 public function getValidationRules(DocumentInterface $document, Validator $validator)
 {
     $rules = [];
     if ($this->isRequired()) {
         $rules[] = 'required';
     }
     if ($this->isUnique()) {
         $table = $this->getSection()->getSectionTableName();
         if (is_null($uniqueRule = $this->getSetting('unique_rule'))) {
             $uniqueRule = 'unique::table,:field,:id,:id_field';
         }
         $replace = [':table' => $table, ':field' => $this->getDBKey(), ':id' => $document->exists ? $document->getId() : 'NULL', ':id_field' => $document->getKeyName()];
         foreach ($validator->getData() as $field => $value) {
             $replace['@' . $field] = is_array($value) ? implode(',', $value) : $value;
         }
         $uniqueRule = strtr($uniqueRule, $replace);
         $uniqueRule = preg_replace('/(\\,\\@[a-z_-]+)/', ',NULL', $uniqueRule);
         $rules[] = $uniqueRule;
     }
     if (!is_null($customRules = $this->getSetting('validation_rules'))) {
         $rules += explode('|', $customRules);
     }
     return $rules;
 }
開發者ID:KodiComponents,項目名稱:module-datasource,代碼行數:30,代碼來源:Field.php

示例7: decisionType

 public function decisionType($attribute, $value, $parameters, Validator $validator)
 {
     if (array_get($validator->getData(), 'matching_type', 'decision') == 'scoring') {
         return 'numeric' == $value;
     }
     return true;
 }
開發者ID:Nebo15,項目名稱:gandalf.api,代碼行數:7,代碼來源:TableValidator.php

示例8: fromValidator

 public static function fromValidator(Validator $validator)
 {
     return new self($validator->errors(), $validator->getData());
 }
開發者ID:msivia,項目名稱:Toolbox,代碼行數:4,代碼來源:ValidationException.php

示例9: guardaRevisionFactura

 /**
  * Guarda la revisión de la factura realizada.
  *
  * @access protected
  * @param  Illuminate\Validation\Validator Object  $validation
  * @param  Factura Object  $factura
  * @return Factura Object
  */
 protected function guardaRevisionFactura(\Illuminate\Validation\Validator $validation, Factura $factura)
 {
     $datos = array_merge($validation->getData(), ['factura_fecha_revision' => date("Y-m-d H:i:s"), 'factura_revision_usuario_id' => Auth::user()->usuario_id]);
     $factura->fill($datos);
     $factura->save();
     if ($factura->factura_notificacion_revision > 0) {
         $this->enviaCorreoNotificacionReivision($factura);
     }
     return $factura;
 }
開發者ID:egalink,項目名稱:proveedores,代碼行數:18,代碼來源:RevisionController.php


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