class JobListBuilder

Provides the views data for the message entity type.

Hierarchy

  • class \Drupal\tmgmt\Entity\ListBuilder\JobListBuilder extends \Drupal\Core\Entity\EntityListBuilder

Expanded class hierarchy of JobListBuilder

File

src/Entity/ListBuilder/JobListBuilder.php, line 13

Namespace

Drupal\tmgmt\Entity\ListBuilder
View source
class JobListBuilder extends EntityListBuilder {

  /**
   * {@inheritdoc}
   */
  protected function getDefaultOperations(EntityInterface $entity) {
    $operations = parent::getDefaultOperations($entity);
    if ($entity
      ->isSubmittable() && $entity
      ->access('submit')) {
      $operations['submit'] = array(
        'url' => $entity
          ->toUrl()
          ->setOption('query', array(
          'destination' => Url::fromRoute('<current>')
            ->getInternalPath(),
        )),
        'title' => t('Submit'),
        'weight' => -10,
      );
    }
    else {
      $operations['manage'] = array(
        'url' => $entity
          ->toUrl()
          ->setOption('query', array(
          'destination' => Url::fromRoute('<current>')
            ->getInternalPath(),
        )),
        'title' => t('Manage'),
        'weight' => -10,
      );
    }
    if ($entity
      ->isAbortable() && $entity
      ->access('submit')) {
      $operations['abort'] = array(
        'url' => $entity
          ->toUrl('abort-form')
          ->setOption('query', array(
          'destination' => Url::fromRoute('<current>')
            ->getInternalPath(),
        )),
        'title' => t('Abort'),
        'weight' => 10,
      );
    }
    return $operations;
  }

}

Members