Elgg  Version 6.1
ContainerLogicHandler.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Comments;
4 
11 
19  public function __invoke(\Elgg\Event $event) {
20  if ($event->getParam('subtype') !== 'comment') {
21  return;
22  }
23 
24  $container = $event->getParam('container');
25  if (!$container instanceof \ElggEntity) {
26  return;
27  }
28 
29  if (!$container->hasCapability('commentable')) {
30  return false;
31  }
32  }
33 }
__invoke(\Elgg\Event $event)
Prevent commenting on a container if container is not commentable.
$container
Definition: delete.php:23
Check commentable capability for a container.
Models an event passed to event handlers.
Definition: Event.php:11