base\Model getValidators()

getValidators() public method Returns all the validators declared in rules(). This method differs from getActiveValidators() in that the latter only returns the validators applicable to the current $scenario. Because this method returns an ArrayObject object, you may manipulate it by inserting or removing validators (useful in model behaviors). For example, $model->validators[] = $newValidator; public ArrayObject|yii\validators\Validator[] getValidators ( )return ArrayObject|yii\vali

base\Model getIterator()

getIterator() public method Returns an iterator for traversing the attributes in the model. This method is required by the interface IteratorAggregate. public ArrayIterator getIterator ( )return ArrayIterator An iterator for traversing the items in the list.

base\Model getScenario()

getScenario() public method Returns the scenario that this model is used in. Scenario affects how validation is performed and which attributes can be massively assigned. public string getScenario ( )return string The scenario that this model is in. Defaults to SCENARIO_DEFAULT.

base\Model getErrors()

getErrors() public method Returns the errors for all attributes or a single attribute. See also: getFirstErrors() getFirstError() public array getErrors ( $attribute = null )$attribute string Attribute name. Use null to retrieve errors for all attributes. return array 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' =&

base\Model getFirstError()

getFirstError() public method Returns the first error of the specified attribute. See also: getErrors() getFirstErrors() public string getFirstError ( $attribute )$attribute string Attribute name. return string The error message. Null is returned if no error.

base\Model getFirstErrors()

getFirstErrors() public method Returns the first error of every attribute in the model. See also: getErrors() getFirstError() public array getFirstErrors ( )return array 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.

base\Model getAttributes()

getAttributes() public method Returns attribute values. public array getAttributes ( $names = null, $except = [] )$names array List of attributes whose value needs to be returned. Defaults to null, meaning all attributes listed in attributes() will be returned. If it is an array, only the attributes in the array will be returned. $except array List of attributes whose value should NOT be returned. return array Attribute values (name => value).

base\Model getActiveValidators()

getActiveValidators() public method Returns the validators applicable to the current $scenario. public yii\validators\Validator[] getActiveValidators ( $attribute = null )$attribute string The name of the attribute whose applicable validators should be returned. If this is null, the validators for ALL attributes in the model will be returned. return yii\validators\Validator[] The validators applicable to the current $scenario.

base\Model getAttributeLabel()

getAttributeLabel() public method Returns the text label for the specified attribute. See also: generateAttributeLabel() attributeLabels() public string getAttributeLabel ( $attribute )$attribute string The attribute name return string The attribute label

base\Model getAttributeHint()

getAttributeHint() public method (available since version 2.0.4) Returns the text hint for the specified attribute. See also attributeHints(). public string getAttributeHint ( $attribute )$attribute string The attribute name return string The attribute hint