MentionCommentActivityEntityCondition.php in Open Social 8.4
Same filename and directory in other branches
- 8.9 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 8 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 8.2 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 8.3 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 8.5 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 8.6 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 8.7 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 8.8 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 10.3.x modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 10.0.x modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 10.1.x modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
- 10.2.x modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.php
File
modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionCommentActivityEntityCondition.phpView source
<?php
namespace Drupal\social_mentions\Plugin\ActivityEntityCondition;
use Drupal\activity_creator\Plugin\ActivityEntityConditionBase;
/**
* Provides a 'MentionsComment' activity condition.
*
* @ActivityEntityCondition(
* id = "mention_comment",
* label = @Translation("Mentions in a comment"),
* entities = {"mentions" = {}}
* )
*/
class MentionCommentActivityEntityCondition extends ActivityEntityConditionBase {
/**
* {@inheritdoc}
*/
public function isValidEntityCondition($entity) {
if ($entity
->getEntityTypeId() === 'mentions') {
if (isset($entity->entity_type) && $entity->entity_type->value == 'comment') {
return TRUE;
}
}
return FALSE;
}
}
Classes
Name | Description |
---|---|
MentionCommentActivityEntityCondition | Provides a 'MentionsComment' activity condition. |