You are here

public function MentionPostActivityEntityCondition::isValidEntityCondition in Open Social 8.6

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  2. 8 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  3. 8.2 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  4. 8.3 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  5. 8.4 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  6. 8.5 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  7. 8.7 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  8. 8.8 modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  9. 10.3.x modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  10. 10.0.x modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  11. 10.1.x modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()
  12. 10.2.x modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php \Drupal\social_mentions\Plugin\ActivityEntityCondition\MentionPostActivityEntityCondition::isValidEntityCondition()

Checks if this is a valid entity condition for the action.

Overrides ActivityEntityConditionBase::isValidEntityCondition

File

modules/social_features/social_mentions/src/Plugin/ActivityEntityCondition/MentionPostActivityEntityCondition.php, line 21

Class

MentionPostActivityEntityCondition
Provides a 'MentionPost' activity condition.

Namespace

Drupal\social_mentions\Plugin\ActivityEntityCondition

Code

public function isValidEntityCondition($entity) {
  if ($entity
    ->getEntityTypeId() === 'mentions') {
    if (isset($entity->entity_type) && $entity->entity_type->value == 'post') {
      return TRUE;
    }
  }
  return FALSE;
}