Elgg
Version master
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
classes
Elgg
Comments
UpdateRiverLastActionHandler.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Elgg\Comments
;
4
10
class
UpdateRiverLastActionHandler
{
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 \
ElggComment
||
$item
->action_type !==
'comment'
) {
27
return
;
28
}
29
30
// find create river and update the river item
31
$river =
elgg_get_river
([
32
'object_guid'
=>
$item
->target_guid,
33
'action'
=>
'create'
,
34
'limit'
=> 1,
35
]);
36
if
(empty($river)) {
37
return
;
38
}
39
40
$old_item = $river[0];
41
$old_item->updateLastAction(
$item
->getTimePosted());
42
}
43
}
$item
if(!$items) $item
Definition:
delete.php:13
ElggComment
Definition:
ElggComment.php:11
Elgg\Comments
Definition:
AutoSubscribeHandler.php:3
Elgg
Definition:
ActionsService.php:3
elgg_get_river
elgg_get_river(array $options=[])
Get river items.
Definition:
river.php:101
Elgg\Comments\UpdateRiverLastActionHandler\__invoke
__invoke(\Elgg\Event $event)
Updates the last action of a related river item.
Definition:
UpdateRiverLastActionHandler.php:19
$object
if($email instanceof\Elgg\Email) $object
Definition:
body.php:24
ElggRiverItem
Definition:
ElggRiverItem.php:18
Elgg\Comments\UpdateRiverLastActionHandler
Updates river item last action.
Definition:
UpdateRiverLastActionHandler.php:10
Elgg\Event
Models an event passed to event handlers.
Definition:
Event.php:11
Generated on Sat Dec 21 2024 00:02:51 for Elgg by
1.8.11