public function ContentInMyGroupActivityContext::isValidEntity in Open Social 8.2
Same name and namespace in other branches
- 8.9 modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 8 modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 8.3 modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 8.4 modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 8.5 modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 8.6 modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 8.7 modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 8.8 modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 10.3.x modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 10.0.x modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 10.1.x modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
- 10.2.x modules/custom/activity_basics/src/Plugin/ActivityContext/ContentInMyGroupActivityContext.php \Drupal\activity_basics\Plugin\ActivityContext\ContentInMyGroupActivityContext::isValidEntity()
Determines if the entity is valid for this context.
Overrides ActivityContextBase::isValidEntity
File
- modules/
custom/ activity_basics/ src/ Plugin/ ActivityContext/ ContentInMyGroupActivityContext.php, line 74
Class
- ContentInMyGroupActivityContext
- Provides a 'ContentInMyGroupActivityContext' acitivy context.
Namespace
Drupal\activity_basics\Plugin\ActivityContextCode
public function isValidEntity($entity) {
// Check if it's placed in a group (regardless off content type).
if ($entity
->getEntityTypeId() === 'group_content') {
return TRUE;
}
if ($entity
->getEntityTypeId() === 'post') {
if (!empty($entity
->get('field_recipient_group')
->getValue())) {
return TRUE;
}
}
return FALSE;
}