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