Property | Type | Description | |
---|---|---|---|
$comboNotUnique | string | ||
$filter | additional filter to be applied to the DB query used to check the uniqueness of the attribute value. This can be a string or an array representing the additional query condition (refer to [[\yii\db\Query::where()]] on the format of query condition), or an anonymous function with the signature function ($query), where $query is the [[\yii\db\Query|Query]] object that you can modify in the function. | ||
$message | the user-defined error message. When validating single attribute, it may contain the following placeholders which will be replaced accordingly by the validator: - {attribute}: the label of the attribute being validated - {value}: the value of the attribute being validated When validating mutliple attributes, it may contain the following placeholders: - {attributes}: the labels of the attributes being validated. - {values}: the values of the attributes being validated. | ||
$targetAttribute | the name of the ActiveRecord attribute that should be used to validate the uniqueness of the current attribute value. If not set, it will use the name of the attribute currently being validated. You may use an array to validate the uniqueness of multiple columns at the same time. The array values are the attributes that will be used to validate the uniqueness, while the array keys are the attributes whose values are to be validated. If the key and the value are the same, you can just specify the value. | ||
$targetClass | the name of the ActiveRecord class that should be used to validate the uniqueness of the current attribute value. If not set, it will use the ActiveRecord class of the attribute being validated. |
Method | Description | |
---|---|---|
init ( ) | ||
validateAttribute ( $model, $attribute ) |
Method | Description | |
---|---|---|
addComboNotUniqueError ( |
Builds and adds [[comboNotUnique]] error message to the specified model attribute. |
public $filter |
public $message |
public $targetAttribute |