activity_stream-1.0.x-dev/src/Plugin/ActivityEntityCondition/CommentNotReplyActivityEntityCondition.php
src/Plugin/ActivityEntityCondition/CommentNotReplyActivityEntityCondition.php
<?php
namespace Drupal\activity_stream\Plugin\ActivityEntityCondition;
use Drupal\activity_stream\Plugin\ActivityEntityConditionBase;
use Drupal\comment\CommentInterface;
/**
* Provides a 'CommentNotReply' activity condition.
*
* @ActivityEntityCondition(
* id = "comment_not_reply",
* label = @Translation("Not reply comment"),
* entities = {"comment" = {}}
* )
*/
class CommentNotReplyActivityEntityCondition extends ActivityEntityConditionBase {
/**
* {@inheritdoc}
*/
public function isValidEntityCondition($entity) : bool {
return $entity instanceof CommentInterface && $entity->getParentComment() === NULL;
}
}
