CommentLazyBuilders
class CommentLazyBuilders implements TrustedCallbackInterface (View source)
Defines a service for comment #lazy_builder callbacks.
Traits
Provides a standard way to announce deprecated properties.
Properties
| protected | $deprecatedProperties | {@inheritdoc} | |
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager service. |
|
| protected EntityFormBuilderInterface | $entityFormBuilder | The entity form builder service. |
|
| protected CommentManagerInterface | $commentManager | Comment manager service. |
|
| protected AccountInterface | $currentUser | Current logged in user. |
|
| protected ModuleHandlerInterface | $moduleHandler | The module handler service. |
|
| protected RendererInterface | $renderer | The renderer service. |
Methods
Constructs a new CommentLazyBuilders object.
lazy_builder callback; builds the comment form.
lazy_builder callback; builds a comment's links.
Build the default links (reply, edit, delete …) for a comment.
Lists the trusted callbacks provided by the implementing class.
Details
__get($name)
Allows to access deprecated/removed properties.
This method must be public.
__construct(EntityTypeManagerInterface $entity_type_manager, EntityFormBuilderInterface $entity_form_builder, AccountInterface $current_user, CommentManagerInterface $comment_manager, ModuleHandlerInterface $module_handler, RendererInterface $renderer)
Constructs a new CommentLazyBuilders object.
array
renderForm(string $commented_entity_type_id, string $commented_entity_id, string $field_name, string $comment_type_id)
lazy_builder callback; builds the comment form.
array
renderLinks(string $comment_entity_id, string $view_mode, string $langcode, bool $is_in_preview)
lazy_builder callback; builds a comment's links.
protected array
buildLinks(CommentInterface $entity, EntityInterface $commented_entity)
Build the default links (reply, edit, delete …) for a comment.
protected
access(EntityInterface $entity)
Wraps content_translation_translate_access.
static string[]
trustedCallbacks()
Lists the trusted callbacks provided by the implementing class.
Trusted callbacks are public methods on the implementing class and can be invoked via \Drupal\Core\Security\DoTrustedCallbackTrait::doTrustedCallback().