base\Module $aliases

$aliases public write-only property List of path aliases to be defined. The array keys are alias names (must start with @) and the array values are the corresponding paths or aliases. For example, [ '@models' => '@app/models', // an existing alias '@backend' => __DIR__ . '/../backend', // a directory ] public void setAliases ( $aliases )

base\ModelEvent $isValid

$isValid public property Whether the model is in valid status. Defaults to true. A model is in valid status if it passes validations or certain checks. public boolean $isValid = true

base\Model validate()

validate() public method Performs the data validation. This method executes the validation rules applicable to the current $scenario. The following criteria are used to determine whether a rule is currently applicable: the rule must be associated with the attributes relevant to the current scenario; the rules must be effective for the current scenario. This method will call beforeValidate() and afterValidate() before and after the actual validation, respectively. If beforeValidate() returns

base\Model validateMultiple()

validateMultiple() public static method Validates multiple models. This method will validate every model. The models being validated may be of the same or different types. public static boolean validateMultiple ( $models, $attributeNames = null )$models array The models to be validated $attributeNames array List of attribute names that should be validated. If this parameter is empty, it means any attribute listed in the applicable validation rules should be validated. return boolean

base\Model setScenario()

setScenario() public method Sets the scenario for the model. Note that this method does not check if the scenario exists or not. The method validate() will perform this check. public void setScenario ( $value )$value string The scenario that this model is in.

base\Model scenarios()

scenarios() public method Returns a list of scenarios and the corresponding active attributes. An active attribute is one that is subject to validation in the current scenario. The returned array should be in the following format: [ 'scenario1' => ['attribute11', 'attribute12', ...], 'scenario2' => ['attribute21', 'attribute22', ...], ... ] By default, an active attribute is considered safe and can be massively assigned. If an attribute should NOT be massively assigned (t

base\Model safeAttributes()

safeAttributes() public method Returns the attribute names that are safe to be massively assigned in the current scenario. public string[] safeAttributes ( )return string[] Safe attribute names

base\Model setAttributes()

setAttributes() public method Sets the attribute values in a massive way. See also: safeAttributes() attributes() public void setAttributes ( $values, $safeOnly = true )$values array Attribute values (name => value) to be assigned to the model. $safeOnly boolean Whether the assignments should only be done to the safe attributes. A safe attribute is one that is associated with a validation rule in the current $scenario.

base\Model rules()

rules() public method Returns the validation rules for attributes. Validation rules are used by validate() to check if attribute values are valid. Child classes may override this method to declare different validation rules. Each rule is an array with the following structure: [ ['attribute1', 'attribute2'], 'validator type', 'on' => ['scenario1', 'scenario2'], //...other parameters... ] where attribute list: required, specifies the attributes array to be validated, for s

base\Model onUnsafeAttribute()

onUnsafeAttribute() public method This method is invoked when an unsafe attribute is being massively assigned. The default implementation will log a warning message if YII_DEBUG is on. It does nothing otherwise. public void onUnsafeAttribute ( $name, $value )$name string The unsafe attribute name $value mixed The attribute value