Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1161212
discounts_event_handler.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
Sat, Sep 20, 1:24 AM
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Sep 22, 1:24 AM (5 h, 27 m)
Engine
blob
Format
Raw Data
Handle
751130
Attached To
rMINC Modules.In-Commerce
discounts_event_handler.php
View Options
<?php
/**
* @version $Id: discounts_event_handler.php 14625 2011-10-04 09:34:12Z alex $
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
defined
(
'FULL_PATH'
)
or
die
(
'restricted access!'
);
class
DiscountsEventHandler
extends
kDBEventHandler
{
/**
* Occurs before updating item
*
* @param kEvent $event
* @return void
* @access protected
*/
protected
function
OnBeforeItemUpdate
(&
$event
)
{
parent
::
OnBeforeItemUpdate
(
$event
);
$this
->
itemChanged
(
$event
);
}
/**
* Occurs before creating item
*
* @param kEvent $event
* @return void
* @access protected
*/
protected
function
OnBeforeItemCreate
(&
$event
)
{
parent
::
OnBeforeItemCreate
(
$event
);
$this
->
itemChanged
(
$event
);
}
/**
* Occurs before item changed
*
* @param kEvent $event
*/
function
itemChanged
(&
$event
)
{
$object
=&
$event
->
getObject
();
/* @var $object kDBItem */
$object
->
SetDBField
(
'Amount'
,
abs
(
$object
->
GetDBField
(
'Amount'
)));
}
}
Event Timeline
Log In to Comment