You are here

GroupMembershipStatus.php in Opigno Learning path 3.x

Same filename and directory in other branches
  1. 8 src/Plugin/views/field/GroupMembershipStatus.php

File

src/Plugin/views/field/GroupMembershipStatus.php
View source
<?php

namespace Drupal\opigno_learning_path\Plugin\views\field;

use Drupal\opigno_learning_path\LearningPathAccess;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;

/**
 * Field handler for group user membership status.
 *
 * @ingroup views_field_handlers
 *
 * @ViewsField("group_membership_status")
 */
class GroupMembershipStatus extends FieldPluginBase {

  /**
   * {@inheritdoc}
   */
  public function query() {
  }

  /**
   * {@inheritdoc}
   */
  public function render(ResultRow $values) {
    return $values->_entity
      ->bundle() === 'learning_path-group_membership' ? LearningPathAccess::getMembershipStatus($values->_entity
      ->id(), TRUE) : $this
      ->t('no status');
  }

}

Classes

Namesort descending Description
GroupMembershipStatus Field handler for group user membership status.