You are here

CommentAllActivityEntityCondition.php in Open Social 8.5

File

modules/custom/activity_basics/src/Plugin/ActivityEntityCondition/CommentAllActivityEntityCondition.php
View source
<?php

namespace Drupal\activity_basics\Plugin\ActivityEntityCondition;

use Drupal\activity_creator\Plugin\ActivityEntityConditionBase;

/**
 * Provides a 'CommentReply' activity condition.
 *
 * @ActivityEntityCondition(
 *  id = "comment_all",
 *  label = @Translation("All comments"),
 *  entities = {"comment" = {}}
 * )
 */
class CommentAllActivityEntityCondition extends ActivityEntityConditionBase {

  /**
   * {@inheritdoc}
   */
  public function isValidEntityCondition($entity) {
    if ($entity
      ->getEntityTypeId() === 'comment') {
      return TRUE;
    }
    return FALSE;
  }

}

Classes

Namesort descending Description
CommentAllActivityEntityCondition Provides a 'CommentReply' activity condition.