Свойство | Type | Description | |
---|---|---|---|
$allowArray | whether to allow array type attribute. | ||
$filter | additional filter to be applied to the DB query used to check the existence 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. | ||
$targetAttribute | the name of the ActiveRecord attribute that should be used to validate the existence 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 existence of multiple columns at the same time. The array values are the attributes that will be used to validate the existence, 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 existence of the current attribute value. It not set, it will use the ActiveRecord class of the attribute being validated. |
Méthode | Description | |
---|---|---|
init ( ) | ||
validateAttribute ( $model, $attribute ) |
Méthode | Description | |
---|---|---|
createQuery ( string $targetClass, mixed $condition ) : yii\db\ActiveQueryInterface | Creates a query instance with the given condition. | |
validateValue ( $value ) |
protected createQuery ( string $targetClass, mixed $condition ) : yii\db\ActiveQueryInterface | ||
$targetClass | string | the target AR class |
$condition | mixed | query condition |
Résultat | yii\db\ActiveQueryInterface | the query instance |
public $filter |
public $targetAttribute |