Page MenuHomeIn-Portal Phabricator

coupon_items_tag_processor.php
No OneTemporary

File Metadata

Created
Fri, Nov 21, 2:28 PM

coupon_items_tag_processor.php

<?php
/**
* @version $Id: coupon_items_tag_processor.php 16522 2017-01-20 20:28:16Z 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 CouponItemsTagProcessor extends kDBTagProcessor {
function IsEntireOrder($params)
{
$table_name = $this->getUnitConfig()->getTableName();
if ( $this->Application->IsTempMode($this->Prefix) ) {
$table_name = $this->Application->GetTempName($table_name, 'prefix:' . $this->Prefix);
}
$sql = 'SELECT COUNT(*)
FROM ' . $table_name . '
WHERE (ItemType = 0) AND (CouponId = ' . $this->Application->GetVar('coup_id') . ')';
return $this->Conn->GetOne($sql);
}
function ItemIcon($params)
{
/** @var kDBList $object */
$object = $this->getObject($params);
if ( $object->GetDBField('ItemType') == 2 ) {
$cat_object = $this->Application->recallObject('c');
/* @var $cat_object CategoriesItem */
$cat_object->Load($object->GetDBField('CategoryId'));
$cat_tag_processor = $this->Application->recallObject('c_TagProcessor');
/* @var $cat_tag_processor CategoriesTagProcessor */
return $cat_tag_processor->ItemIcon($params);
}
return parent::ItemIcon($params);
}
}

Event Timeline