Overview

Namespaces

  • None
  • Wei
    • Validator

Classes

  • All
  • AllOf
  • Alnum
  • Alpha
  • BaseValidator
  • Between
  • Blank
  • Callback
  • CharLength
  • Chinese
  • Color
  • Contains
  • CreditCard
  • Date
  • DateTime
  • Decimal
  • Digit
  • Dir
  • DivisibleBy
  • DoubleByte
  • Email
  • EndsWith
  • EqualTo
  • Exists
  • FieldExists
  • File
  • GreaterThan
  • GreaterThanOrEqual
  • IdCardCn
  • IdCardHk
  • IdCardMo
  • IdCardTw
  • IdenticalTo
  • Image
  • In
  • Ip
  • Length
  • LessThan
  • LessThanOrEqual
  • Lowercase
  • Luhn
  • MaxLength
  • MinLength
  • MobileCn
  • NaturalNumber
  • NoneOf
  • Null
  • Number
  • OneOf
  • Password
  • Phone
  • PhoneCn
  • PlateNumberCn
  • PositiveInteger
  • PostcodeCn
  • Present
  • QQ
  • RecordExists
  • Regex
  • Required
  • SomeOf
  • StartsWith
  • Time
  • Tld
  • Type
  • Uppercase
  • Url
  • Uuid
  • Overview
  • Namespace
  • Class

Class SomeOf

Check if the input is valid by specified number of the rules

Wei\Base
Extended by Wei\Validator\BaseValidator
Extended by Wei\Validator\SomeOf

Direct known subclasses

Wei\Validator\AllOf, Wei\Validator\NoneOf, Wei\Validator\OneOf
Namespace: Wei\Validator
Author: Twin Huang twinhuang@qq.com
Located at Validator/SomeOf.php
Methods summary
public boolean
# __invoke( mixed $input, array $rules = array(), $atLeast = null )

Validate the input value

Validate the input value

Parameters

$input
$rules
$atLeast

Returns

boolean

Overrides

Wei\Validator\BaseValidator::__invoke()
protected boolean
# doValidate( mixed $input )

Validate the input value (ignore the $negative property)

Validate the input value (ignore the $negative property)

Parameters

$input
The input to be validated

Returns

boolean
protected
# reset( )

Reset validator status

Reset validator status

public array
# getMessages( string $name = null )

Returns the error messages

Returns the error messages

Parameters

$name
The name display in error message

Returns

array

Throws

UnexpectedValueException
When message contains unknown parameter

Overrides

Wei\Validator\BaseValidator::getMessages()
Methods inherited from Wei\Validator\BaseValidator
addError(), getErrors(), getFirstMessage(), getJoinedMessage(), getName(), hasError(), isString(), isValid(), loadTranslationMessages(), setMessages(), setName(), storeOption()
Methods inherited from Wei\Base
__call(), __construct(), __get(), getOption(), setOption()
Magic methods inherited from Wei\Validator\BaseValidator
t()
Properties summary
protected string $atLeastMessage
# '%name% must be passed by at least %left% of %count% rules'
protected array $rules

The validator rules

The validator rules

Format: array( 'email' => true, 'endsWith' => array( 'findMe' => '@google.com' ) );

# array()
protected integer $atLeast

How many rules should pass at least

How many rules should pass at least

#
protected boolean $combineMessages

Whether combine messages into single one or not

Whether combine messages into single one or not

# true
protected string $count

The passed rules number, using for message only

The passed rules number, using for message only

#
protected string $left

The not passed rules number, using for message only

The not passed rules number, using for message only

#
protected Wei\Validator\BaseValidator[] $validators

The invalid validators

The invalid validators

# array()
Properties inherited from Wei\Validator\BaseValidator
$errors, $name, $negative, $negativeMessage, $notStringMessage, $validator
Properties inherited from Wei\Base
$providers, $wei
Magic properties inherited from Wei\Validator\BaseValidator
$t
Wei Framework API documentation generated by ApiGen