Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1169003
l-visit_eh.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Sep 25, 6:32 PM
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Sep 27, 6:32 PM (1 d, 10 h)
Engine
blob
Format
Raw Data
Handle
757359
Attached To
rMINL Modules.In-Link
l-visit_eh.php
View Options
<?php
/**
* @version $Id: l-visit_eh.php 15150 2012-03-04 09:05:14Z alex $
* @package In-Link
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined
(
'FULL_PATH'
)
or
die
(
'restricted access!'
);
class
LinkVisitEventHandler
extends
kDBEventHandler
{
/**
* Deletes visits when user/link got deleted
*
* @param kEvent $event
*/
function
OnDeleteVisits
(
$event
)
{
$key_field
=
$event
->
MasterEvent
->
Prefix
==
'u'
?
'PortalUserId'
:
'ResourceId'
;
$table_name
=
$this
->
Application
->
getUnitOption
(
$this
->
Prefix
,
'TableName'
);
$object
=
$event
->
MasterEvent
->
getObject
();
$sql
=
'DELETE FROM '
.
$table_name
.
'
WHERE '
.
$key_field
.
' = '
.
$object
->
GetDBField
(
$key_field
);
$this
->
Conn
->
Query
(
$sql
);
}
}
Event Timeline
Log In to Comment