-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcron.php
More file actions
53 lines (42 loc) · 1.37 KB
/
cron.php
File metadata and controls
53 lines (42 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
class Event_Cron extends OW_Cron
{
public function __construct()
{
parent::__construct();
$this->addJob('clearInvitations', 20);
}
public function run()
{
//ignore
}
public function clearInvitations()
{
$list = EVENT_BOL_EventService::getInstance()->findCronExpiredEvents(0, 1500);
if ( !empty($list) )
{
/* @var $event EVENT_BOL_Event */
foreach ( $list as $event )
{
EVENT_BOL_EventService::getInstance()->clearEventInvitations($event->id);
OW::getEventManager()->call('invitations.remove', array(
'entityType' => 'event',
'entityId' => $event->id
));
OW::getEventManager()->call('invitations.remove', array(
'entityType' => EVENT_CLASS_InvitationHandler::INVITATION_JOIN,
'entityId' => $event->id
));
OW::getEventManager()->call('notifications.remove', array(
'entityType' => 'event',
'entityId' => $event->id
));
}
}
}
}