Drupal 8  8.0.2
CommentLazyBuilders Class Reference

Public Member Functions

 __construct (EntityManagerInterface $entity_manager, EntityFormBuilderInterface $entity_form_builder, AccountInterface $current_user, CommentManagerInterface $comment_manager, ModuleHandlerInterface $module_handler, RendererInterface $renderer)
 
 renderForm ($commented_entity_type_id, $commented_entity_id, $field_name, $comment_type_id)
 

Protected Member Functions

 buildLinks (CommentInterface $entity, EntityInterface $commented_entity)
 
 access (EntityInterface $entity)
 

Protected Attributes

 $entityManager
 
 $entityFormBuilder
 
 $commentManager
 
 $currentUser
 
 $moduleHandler
 
 $renderer
 

Detailed Description

Defines a service for comment #lazy_builder callbacks.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entity_manager,
EntityFormBuilderInterface  $entity_form_builder,
AccountInterface  $current_user,
CommentManagerInterface  $comment_manager,
ModuleHandlerInterface  $module_handler,
RendererInterface  $renderer 
)

Constructs a new CommentLazyBuilders object.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager service.
\Drupal\Core\Entity\EntityFormBuilderInterface$entity_form_builderThe entity form builder service.
\Drupal\Core\Session\AccountInterface$current_userThe current logged in user.
\Drupal\comment\CommentManagerInterface$comment_managerThe comment manager service.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler service.
\Drupal\Core\Render\RendererInterface$rendererThe renderer service.

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

Here is the call graph for this function:

Member Function Documentation

access ( EntityInterface  $entity)
protected

Wraps content_translation_translate_access.

Referenced by CommentLazyBuilders\buildLinks().

Here is the caller graph for this function:

buildLinks ( CommentInterface  $entity,
EntityInterface  $commented_entity 
)
protected

Build the default links (reply, edit, delete …) for a comment.

Parameters
\Drupal\comment\CommentInterface$entityThe comment object.
\Drupal\Core\Entity\EntityInterface$commented_entityThe entity to which the comment is attached.
Returns
array An array that can be processed by drupal_pre_render_links().

References AccessibleInterface\access(), CommentLazyBuilders\access(), Drupal\currentUser(), Url\fromRoute(), CommentInterface\getCommentedEntityId(), CommentInterface\getCommentedEntityTypeId(), CommentInterface\getFieldName(), EntityInterface\id(), CommentInterface\isPublished(), Drupal\moduleHandler(), CommentItemInterface\OPEN, t(), and EntityInterface\urlInfo().

Here is the call graph for this function:

renderForm (   $commented_entity_type_id,
  $commented_entity_id,
  $field_name,
  $comment_type_id 
)

#lazy_builder callback; builds the comment form.

Parameters
string$commented_entity_type_idThe commented entity type ID.
string$commented_entity_idThe commented entity ID.
string$field_nameThe comment field name.
string$comment_type_idThe comment type ID.
Returns
array A renderable array containing the comment form.

References Drupal\entityManager().

Here is the call graph for this function:


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