PHP Interface Esensi\Model\Contracts\ValidatingModelInterface

See also: Watson\Validating\ValidatingInterface
Deprecation: 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.
Author: Daniel LaBarge ([email protected])
Inheritance: extends Watson\Validating\ValidatingInterface
Datei anzeigen Open project: esensi/model

Public Methods

Method Description
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.

Method Details

addRules() public method

Add rules to the existing rules or ruleset, overriding any existing.
Deprecation: watson/[email protected]
public addRules ( array $rules, string $ruleset = null )
$rules array
$ruleset string

getDefaultRules() public method

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.
Deprecation: watson/[email protected]
public getDefaultRules ( ) : array
return array

getRuleset() public method

Get a ruleset, and merge it with saving if required.
Deprecation: watson/[email protected]
public getRuleset ( string $ruleset, boolean $mergeWithSaving = false ) : array
$ruleset string
$mergeWithSaving boolean
return array

getRulesets() public method

Get all the rulesets.
Deprecation: watson/[email protected]
public getRulesets ( ) : array
return array

isInvalid() public method

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])
return boolean

isValid() public method

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])
return boolean

isValidOrFail() public method

Returns if the model is valid, otherwise throws an exception.
public isValidOrFail ( string $ruleset = null ) : boolean
$ruleset string (@deprecated watson/[email protected])
return boolean

mergeRulesets() public method

Helper method to merge rulesets, with later rules overwriting earlier ones.
Deprecation: watson/[email protected]
public mergeRulesets ( array $keys ) : array
$keys array
return array

removeRules() public method

Remove rules from the existing rules or ruleset.
Deprecation: watson/[email protected]
public removeRules ( mixed $keys, string $ruleset = null )
$keys mixed
$ruleset string

setRuleset() public method

Set the rules used for a particular ruleset.
Deprecation: watson/[email protected]
public setRuleset ( array $rules, string $ruleset )
$rules array
$ruleset string

setRulesets() public method

Set all the rulesets.
Deprecation: watson/[email protected]
public setRulesets ( array $rulesets = null )
$rulesets array

updateRulesetUniques() public method

Update the unique rules of the given ruleset to include the model identifier.
Deprecation: watson/[email protected]
public updateRulesetUniques ( string $ruleset = null )
$ruleset string