PHP Интерфейс Esensi\Model\Contracts\ValidatingModelInterface

См. также: Watson\Validating\ValidatingInterface
Устаревший: In watson/[email protected] the custom methods used below were deprecated in favor of Laravel 5's form request validation classes. Stop using rulesets right now as they will be removed.
Автор: Daniel LaBarge ([email protected])
Наследование: extends Watson\Validating\ValidatingInterface
Показать файл Открыть проект

Открытые методы

Метод Описание
addRules ( array $rules, string $ruleset = null ) Add rules to the existing rules or ruleset, overriding any existing.
getDefaultRules ( ) : array Get the default ruleset for any event. Will first search to see if a 'saving' ruleset exists, fallback to '$rules' and otherwise return an empty array.
getRuleset ( string $ruleset, boolean $mergeWithSaving = false ) : array Get a ruleset, and merge it with saving if required.
getRulesets ( ) : array Get all the rulesets.
isInvalid ( mixed $ruleset = null, boolean $mergeWithSaving = true ) : boolean Returns whether the model is invalid or not.
isValid ( mixed $ruleset = null, boolean $mergeWithSaving = true ) : boolean Returns whether the model is valid or not.
isValidOrFail ( string $ruleset = null ) : boolean Returns if the model is valid, otherwise throws an exception.
mergeRulesets ( array $keys ) : array Helper method to merge rulesets, with later rules overwriting earlier ones.
removeRules ( mixed $keys, string $ruleset = null ) Remove rules from the existing rules or ruleset.
setRuleset ( array $rules, string $ruleset ) Set the rules used for a particular ruleset.
setRulesets ( array $rulesets = null ) Set all the rulesets.
updateRulesetUniques ( string $ruleset = null ) Update the unique rules of the given ruleset to include the model identifier.

Описание методов

addRules() публичный Метод

Add rules to the existing rules or ruleset, overriding any existing.
Устаревший: watson/[email protected]
public addRules ( array $rules, string $ruleset = null )
$rules array
$ruleset string

getDefaultRules() публичный Метод

Get the default ruleset for any event. Will first search to see if a 'saving' ruleset exists, fallback to '$rules' and otherwise return an empty array.
Устаревший: watson/[email protected]
public getDefaultRules ( ) : array
Результат array

getRuleset() публичный Метод

Get a ruleset, and merge it with saving if required.
Устаревший: watson/[email protected]
public getRuleset ( string $ruleset, boolean $mergeWithSaving = false ) : array
$ruleset string
$mergeWithSaving boolean
Результат array

getRulesets() публичный Метод

Get all the rulesets.
Устаревший: watson/[email protected]
public getRulesets ( ) : array
Результат array

isInvalid() публичный Метод

Returns whether the model is invalid or not.
public isInvalid ( mixed $ruleset = null, boolean $mergeWithSaving = true ) : boolean
$ruleset mixed (@deprecated watson/[email protected])
$mergeWithSaving boolean (@deprecated watson/[email protected])
Результат boolean

isValid() публичный Метод

Returns whether the model is valid or not.
public isValid ( mixed $ruleset = null, boolean $mergeWithSaving = true ) : boolean
$ruleset mixed (@deprecated watson/[email protected])
$mergeWithSaving boolean (@deprecated watson/[email protected])
Результат boolean

isValidOrFail() публичный Метод

Returns if the model is valid, otherwise throws an exception.
public isValidOrFail ( string $ruleset = null ) : boolean
$ruleset string (@deprecated watson/[email protected])
Результат boolean

mergeRulesets() публичный Метод

Helper method to merge rulesets, with later rules overwriting earlier ones.
Устаревший: watson/[email protected]
public mergeRulesets ( array $keys ) : array
$keys array
Результат array

removeRules() публичный Метод

Remove rules from the existing rules or ruleset.
Устаревший: watson/[email protected]
public removeRules ( mixed $keys, string $ruleset = null )
$keys mixed
$ruleset string

setRuleset() публичный Метод

Set the rules used for a particular ruleset.
Устаревший: watson/[email protected]
public setRuleset ( array $rules, string $ruleset )
$rules array
$ruleset string

setRulesets() публичный Метод

Set all the rulesets.
Устаревший: watson/[email protected]
public setRulesets ( array $rulesets = null )
$rulesets array

updateRulesetUniques() публичный Метод

Update the unique rules of the given ruleset to include the model identifier.
Устаревший: watson/[email protected]
public updateRulesetUniques ( string $ruleset = null )
$ruleset string