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