Elgg  Version master
UpdateLastActionHandler.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\River;
4 
11 
19  public function __invoke(\Elgg\Event $event) {
20  $item = $event->getObject();
21  if (!$item instanceof \ElggRiverItem) {
22  return;
23  }
24 
25  $object = $item->getObjectEntity();
26  if ($object instanceof \ElggEntity) {
27  $object->updateLastAction($item->getTimePosted());
28  }
29 
30  $target = $item->getTargetEntity();
31  if ($target instanceof \ElggEntity) {
32  $target->updateLastAction($item->getTimePosted());
33  }
34  }
35 }
if(!$items) $item
Definition: delete.php:13
Updates river item last action.
$target
Definition: create.php:17
if($email instanceof\Elgg\Email) $object
Definition: body.php:24
__invoke(\Elgg\Event $event)
Updates the last action of the object of an river item.
Models an event passed to event handlers.
Definition: Event.php:11