How to override entity:link() function?
You should not change the core function. What core does, if $rel is not set, it uses 'canonical'. If you want to use 'delete-form' instead, put this as an argument when using the link function:

$row['config_name'] = $entity-&gt;link(NULL, 'delete-form');


BTW, link() is deprecated, so use toLink() instead.