I have an entity with entitylisthandler
.
In entitylisthandler, i have a function to build row like:
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\mymodule\Entity\xyz*/
$row['id'] = $entity->id();
$row['config_name'] = $entity->link();
//$row['first_name'] = $entity->first_name->value;
$row['ctype'] = $entity->ctype->value;
return $row + parent::buildRow($entity);
}
In @line 3:
$row['config_name'] = $entity->link();
I'm calling link function here which calls entity canonical
link.
How to change this default value 'canonical' to some other link like 'delete-form'?
This is the Drupal core link function which I'm trying to override in entitylistbuilder
file.
public function link($text = NULL, $rel = 'delete-form', array $options = []) {
return $this->toLink($text, $rel, $options)->toString();
}
I have changed its argument from 'canonical' to 'delete-form', but it won't work.