GroupMembershipStatus.php in Opigno Learning path 3.x
Same filename and directory in other branches
File
src/Plugin/views/field/GroupMembershipStatus.phpView 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
Name | Description |
---|---|
GroupMembershipStatus | Field handler for group user membership status. |