当前位置: 首页>>代码示例>>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;未经允许,请勿转载。