framework/validators/UniqueValidator.php
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),
        ]);
    }
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),
        ]);
    }
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 ) , ] ) ; }
Builds and adds [[comboNotUnique]] error message to the specified model attribute.
@param \yii\base\Model $model the data model.
@param string $attribute the name of the attribute.
Builds and adds [[ comboNotUnique ]] error message to the specified model attribute .