Drupal 8  8.0.2
CommentLinkBuilder Class Reference
Inheritance diagram for CommentLinkBuilder:

Public Member Functions

 __construct (AccountInterface $current_user, CommentManagerInterface $comment_manager, ModuleHandlerInterface $module_handler, TranslationInterface $string_translation, EntityManagerInterface $entity_manager)
 
 buildCommentedEntityLinks (FieldableEntityInterface $entity, array &$context)
 

Protected Attributes

 $currentUser
 
 $commentManager
 
 $moduleHandler
 
 $entityManager
 

Detailed Description

Defines a class for building markup for comment links on a commented entity.

Comment links include 'login to post new comment', 'add new comment' etc.

Constructor & Destructor Documentation

__construct ( AccountInterface  $current_user,
CommentManagerInterface  $comment_manager,
ModuleHandlerInterface  $module_handler,
TranslationInterface  $string_translation,
EntityManagerInterface  $entity_manager 
)

Constructs a new CommentLinkBuilder object.

Parameters
\Drupal\Core\Session\AccountInterface$current_userCurrent user.
\Drupal\comment\CommentManagerInterface$comment_managerComment manager service.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerModule handler service.
\Drupal\Core\StringTranslation\TranslationInterface$string_translationString translation service.
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager service.

References Drupal\currentUser(), Drupal\entityManager(), and Drupal\moduleHandler().

Here is the call graph for this function:

Member Function Documentation

buildCommentedEntityLinks ( FieldableEntityInterface  $entity,
array &  $context 
)

{Builds links for the given entity.

Parameters
\Drupal\Core\Entity\FieldableEntityInterface$entityEntity for which the links are being built.
array$contextArray of context passed from the entity view builder.
Returns
array Array of entity links.
}

Implements CommentLinkBuilderInterface.

References Drupal\currentUser(), Drupal\entityManager(), CommentItemInterface\FORM_SEPARATE_PAGE, Url\fromRoute(), CommentItemInterface\HIDDEN, Drupal\moduleHandler(), CommentItemInterface\OPEN, NestedArray\setValue(), and t().

Here is the call graph for this function:


The documentation for this class was generated from the following file: