You are here

registration_handler_field_registration_link_delete.php in Entity Registration 8

Same filename and directory in other branches
  1. 8.2 src/registration_handler_field_registration_link_delete.php

Field handler to render a link to delete a registration.

File

src/registration_handler_field_registration_link_delete.php
View source
<?php

namespace Drupal\registration;


/**
 * @file
 * Field handler to render a link to delete a registration.
 */
class registration_handler_field_registration_link_delete extends registration_handler_field_registration_link {

  /**
   * Renders the link.
   */
  function render_link($entity, $values) {

    // Ensure user has access to delete this registration.
    if (!entity_access('delete', 'registration', $entity)) {
      return;
    }
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['path'] = "registration/{$entity->registration_id}/delete";
    $this->options['alter']['query'] = drupal_get_destination();
    $text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
    return $text;
  }

}

Classes

Namesort descending Description
registration_handler_field_registration_link_delete @file Field handler to render a link to delete a registration.