yii\db\ActiveRelationTrait::getModelKey PHP Method

getModelKey() private method

private getModelKey ( yii\db\ActiveRecordInterface | array $model, array $attributes ) : string
$model yii\db\ActiveRecordInterface | array
$attributes array
return string
    private function getModelKey($model, $attributes)
    {
        $key = [];
        foreach ($attributes as $attribute) {
            $key[] = $this->normalizeModelKey($model[$attribute]);
        }
        if (count($key) > 1) {
            return serialize($key);
        }
        $key = reset($key);
        return is_scalar($key) ? $key : serialize($key);
    }