base\Model attributeHints()

attributeHints() public method (available since version 2.0.4) Returns the attribute hints. Attribute hints are mainly used for display purpose. For example, given an attribute isPublic, we can declare a hint Whether the post should be visible for not logged in users, which provides user-friendly description of the attribute meaning and can be displayed to end users. Unlike label hint will not be generated, if its explicit declaration is omitted. Note, in order to inherit hints defined in t

base\Model afterValidate()

afterValidate() public method This method is invoked after validation ends. The default implementation raises an afterValidate event. You may override this method to do postprocessing after validation. Make sure the parent implementation is invoked so that the event can be raised. public void afterValidate ( )

base\Model addErrors()

addErrors() public method (available since version 2.0.2) Adds a list of errors. public void addErrors ( array $items )$items array A list of errors. The array keys must be attribute names. The array values should be error messages. If an attribute has multiple errors, these errors must be given in terms of an array. You may use the result of getErrors() as the value for this parameter.

base\Model addError()

addError() public method Adds a new error to the specified attribute. public void addError ( $attribute, $error = '' )$attribute string Attribute name $error string New error message

base\Model activeAttributes()

activeAttributes() public method Returns the attribute names that are subject to validation in the current scenario. public string[] activeAttributes ( )return string[] Safe attribute names

base\Model $validators

$validators public read-only property All the validators declared in the model. public ArrayObject|yii\validators\Validator[] getValidators ( )

base\Model $scenario

$scenario public property The scenario that this model is in. Defaults to SCENARIO_DEFAULT. public string getScenario ( )public void setScenario ( $value )

base\Model $iterator

$iterator public read-only property An iterator for traversing the items in the list. public ArrayIterator getIterator ( )

base\Model $firstErrors

$firstErrors public read-only property The first errors. The array keys are the attribute names, and the array values are the corresponding error messages. An empty array will be returned if there is no error. public array getFirstErrors ( )

base\Model $errors

$errors public read-only property Errors for all attributes or the specified attribute. Empty array is returned if no error. Note that when returning errors for all attributes, the result is a two-dimensional array, like the following: [ 'username' => [ 'Username is required.', 'Username must contain only word characters.', ], 'email' => [ 'Email address is invalid.', ] ] public array getErrors ( $attribute = null )