ActivityGroupArgument.php in Open Social 8
Same filename and directory in other branches
- 8.9 modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 8.2 modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 8.3 modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 8.4 modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 8.5 modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 8.6 modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 8.7 modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 8.8 modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 10.3.x modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 10.0.x modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 10.1.x modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
- 10.2.x modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.php
File
modules/custom/activity_viewer/src/Plugin/views/argument/ActivityGroupArgument.phpView source
<?php
namespace Drupal\activity_viewer\Plugin\views\argument;
use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
/**
* Default implementation of the base argument plugin.
*
* @ingroup views_argument_handlers
*
* @ViewsArgument("activity_group_argument")
*/
class ActivityGroupArgument extends ArgumentPluginBase {
/**
* Set up the query for this argument.
*
* The argument sent may be found at $this->argument.
*/
public function query($group_by = FALSE) {
$this
->ensureMyTable();
// \Drupal\views\Plugin\views\query\QueryPluginBase.
$this->query
->addTable('activity__field_activity_recipient_group');
$this->query
->addTable('activity__field_activity_entity');
$this->query
->addTable('activity__field_activity_destinations');
$or_condition = db_or();
// Group is a recipient.
$or_condition
->condition('activity__field_activity_recipient_group.field_activity_recipient_group_target_id', $this->argument, '=');
$this->query
->addWhere('activity_group_argument', $or_condition);
}
/**
* {@inheritdoc}
*/
public function getCacheContexts() {
$cache_contexts = parent::getCacheContexts();
// Since the Stream is different per url.
if (!in_array('url', $cache_contexts)) {
$cache_contexts[] = 'url';
}
return $cache_contexts;
}
}
Classes
Name | Description |
---|---|
ActivityGroupArgument | Default implementation of the base argument plugin. |