yii\validators\UniqueValidator::addComboNotUniqueError PHP Method

addComboNotUniqueError() private method

Builds and adds [[comboNotUnique]] error message to the specified model attribute.
private addComboNotUniqueError ( Model $model, string $attribute )
$model yii\base\Model the data model.
$attribute string the name of the attribute.
    private function addComboNotUniqueError($model, $attribute)
    {
        $attributeCombo = [];
        $valueCombo = [];
        foreach ($this->targetAttribute as $key => $value) {
            if (is_int($key)) {
                $attributeCombo[] = $model->getAttributeLabel($value);
                $valueCombo[] = '"' . $model->{$value} . '"';
            } else {
                $attributeCombo[] = $model->getAttributeLabel($key);
                $valueCombo[] = '"' . $model->{$key} . '"';
            }
        }
        $this->addError($model, $attribute, $this->message, ['attributes' => Inflector::sentence($attributeCombo), 'values' => implode('-', $valueCombo)]);
    }