static public function makeDataForRecord($key, $value, $foreignKeyValue = null) {
        $record = [
            static::getKeysColumnName() => $key,
            static::getValuesColumnName() => static::encodeValue($value),
        ];
        if ($foreignKeyValue !== null && ($foreignKeyColumn = static::getInstance()->getMainForeignKeyColumnName())) {
            $record[$foreignKeyColumn] = $foreignKeyValue;
        }
        return $record;
    }