ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPaymentObject Class Reference
+ Collaboration diagram for ilPaymentObject:

Public Member Functions

 __construct ($user_obj, $a_pobject_id=null)
 getTopicId ()
 setTopicId ($a_topic_id)
 getPobjectId ()
 setRefId ($a_ref_id)
 getRefId ()
 setStatus ($a_status)
 getStatus ()
 setPayMethod ($a_method)
 getPayMethod ()
 setVendorId ($a_vendor_id)
 getVendorId ()
 getVatId ()
 setVatId ($a_vat_id)
 setSubtype ($a_subtype)
 getSubtype ()
 setSpecial ($a_special)
 getSpecial ()
 getVat ($a_amount=0, $type= 'CALCULATION')
 add ()
 delete ()
 update ()

Static Public Member Functions

static _lookupPobjectId ($a_ref_id)
static _lookupTopicId ($a_ref_id)
static _getCountObjectsByPayMethod ($a_id)
static _getObjectsData ($a_user_id)
static _getAllObjectsData ()
static _getObjectData ($a_id)
static _isPurchasable ($a_ref_id, $a_vendor_id=0, $a_check_trustee=false, $a_check_status=false)
static _hasAccess ($a_ref_id, $a_transaction=0, $a_subtype='')
static _isBuyable ($a_ref_id, $a_subtype= '')
static _isNewObject ($a_ref_id)
static _requiresPurchaseToAccess ($a_ref_id, $a_purchasetype= '')
 this function should be used by all buyable repository objects !!
static _isInCart ($a_ref_id)
static _hasExtensions ($a_ref_id)
static _checkExcSubtype ($a_ref_id)
static getAllBuyableObjects ()
static _getSpecialObjects ()
static _getTopicsObjects ($topic_id=NULL)
static _getContainerObjects ($a_ref_id)

Private Member Functions

 __read ()

Private Attributes

 $db = null
 $user_obj = null
 $pobject_id = null
 $ref_id = null
 $status = null
 $pay_method = null
 $vendor_id = null
 $topic_id = 0
 $vat_id = 0
 $subtype = null
 $is_special = 0

Detailed Description

Definition at line 12 of file class.ilPaymentObject.php.

Constructor & Destructor Documentation

ilPaymentObject::__construct (   $user_obj,
  $a_pobject_id = null 
)

Definition at line 27 of file class.ilPaymentObject.php.

References $ilDB, $user_obj, and __read().

{
global $ilDB;
$this->db = $ilDB;
$this->user_obj = $user_obj;
$this->STATUS_NOT_BUYABLE = 0;
$this->STATUS_BUYABLE = 1;
$this->STATUS_EXPIRES = 2;
$this->PAY_METHOD_NOT_SPECIFIED = 0;
$this->pobject_id = $a_pobject_id;
include_once './Services/Payment/classes/class.ilPayMethods.php';
$pmObj = new ilPayMethods();
$tmp = $pmObj->readAll();
foreach($tmp as $pm)
{
$tmp = strtoupper($pm['pm_title']);
$this->PAY_METHOD_.$tmp = $pm['pm_id'];
}
$this->__read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilPaymentObject::__read ( )
private

Definition at line 669 of file class.ilPaymentObject.php.

References $result, $row, getPobjectId(), setPayMethod(), setRefId(), setSpecial(), setStatus(), setSubtype(), setTopicId(), setVatId(), and setVendorId().

Referenced by __construct().

{
if($this->getPobjectId())
{
$result = $this->db->queryf('SELECT * FROM payment_objects WHERE pobject_id = %s',
array('integer'), array($this->getPobjectId()));
while($row = $this->db->fetchObject($result))
{
$this->setRefId($row->ref_id);
$this->setStatus($row->status);
$this->setPayMethod($row->pay_method);
$this->setVendorId($row->vendor_id);
$this->setTopicId($row->pt_topic_fk);
$this->setVatId($row->vat_id);
$this->setSubtype($row->subtype);
$this->setSpecial($row->is_special);
return true;
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilPaymentObject::_checkExcSubtype (   $a_ref_id)
static

Definition at line 694 of file class.ilPaymentObject.php.

References $ilDB, $res, and $row.

Referenced by ilPaymentObjectGUI\addObject(), and ilShopSearchResult\getResultsForPresentation().

{
global $ilDB;
$res = $ilDB->queryF('SELECT * FROM payment_objects WHERE
ref_id = %s', array('integer'), array($a_ref_id));
$subtypes = array();
while($row = $ilDB->fetchAssoc($res))
{
$subtypes[] = $row['subtype'];
}
return $subtypes;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_getAllObjectsData ( )
static

Definition at line 316 of file class.ilPaymentObject.php.

References $_SESSION, $ilDB, $query, $res, and $row.

Referenced by ilObjPaymentSettingsGUI\objectsObject().

{
global $ilDB;
$data_types = array();
$data_values = array();
$query = 'SELECT * FROM payment_objects ';
if ($_SESSION['pay_objects']['title_value'] != '')
{
$query .= ', object_reference obr, object_data od ';
}
if ($_SESSION['pay_objects']['vendor'] != '')
{
$query .= ', usr_data ud ';
}
$query .= ' WHERE 1 = 1 ';
if ($_SESSION['pay_objects']['title_value'])
{
$query .= ' AND obr.ref_id = payment_objects.ref_id AND od.obj_id = obr.obj_id ';
$search_string = '';
$title_search = explode(' ', trim($_SESSION['pay_objects']['title_value']));
for ($i = 0; $i < count($title_search); $i++)
{
$title_search[$i] = trim($title_search[$i]);
if ($title_search[$i] != '')
{
//$search_string .= " od.title LIKE ".$ilDB->quote("%".$title_search[$i]."%")." ";
$search_string .= ' od.title LIKE %s '; // ".$ilDB->quote("%".$title_search[$i]."%")." ";
array_push($data_types, 'text');
array_push($data_values,'%'.$title_search[$i].'%');
switch ($_SESSION['pay_objects']['title_type'])
{
case 'or' :
if ($i < count($title_search) - 1)
{
$search_string .= ' OR ';
}
break;
case 'and' :
if ($i < count($title_search) - 1)
{
$search_string .= ' AND ';
}
break;
}
}
}
if ($search_string != '')
{
$query .= ' AND (' . $search_string . ') ';
}
}
if ($_SESSION['pay_objects']['vendor'] != '')
{
$query .= ' AND ud.usr_id = payment_objects.vendor_id AND login = %s';
array_push($data_types, 'text');
array_push($data_values, $_SESSION['pay_objects']['vendor']);
}
if($_SESSION['pay_objects']['pay_method'] > 0)
{
$query .= ' AND pay_method = %s';
array_push($data_types, 'integer');
array_push($data_values, $_SESSION['pay_objects']['pay_method']);
}
$res = $ilDB->queryf($query, $data_types, $data_values);
$objects = array();
while($row = $ilDB->fetchObject($res))
{
$objects[$row->pobject_id]['pobject_id'] = $row->pobject_id;
$objects[$row->pobject_id]['ref_id'] = $row->ref_id;
$objects[$row->pobject_id]['status'] = $row->status;
$objects[$row->pobject_id]['pay_method'] = $row->pay_method;
$objects[$row->pobject_id]['vendor_id'] = $row->vendor_id;
$objects[$row->pobject_id]['topic_id'] = $row->pt_topic_fk;
$objects[$row->pobject_id]['vat_id'] = $row->vat_id;
$objects[$row->pobject_id]['subtype'] = $row->subtype;
$objects[$row->pobject_id]['is_special'] = $row->is_special;
}
return $objects ? $objects : array();
}

+ Here is the caller graph for this function:

static ilPaymentObject::_getContainerObjects (   $a_ref_id)
static

Definition at line 771 of file class.ilPaymentObject.php.

References $ilDB, $res, and $row.

Referenced by ilShopGUI\showContainerContent().

{
global $ilDB, $tree;
$filter = array( "lm", "sahs", "htlm",'file', 'exc', 'tst', 'icrs','crs','crsr','rcrs', 'glo');
$objects = $tree->getChildsByTypeFilter($a_ref_id, $filter);
$counter = 0;
$obj_res = array();
foreach($objects as $object)
{
if(self::_isBuyable($object['ref_id']))
{
$res = $ilDB->queryF('SELECT * FROM payment_objects
WHERE ref_id = %s AND status = %s
ORDER BY pt_topic_fk',
array('integer', 'integer'), array($object['ref_id'],1));
while($row = $ilDB->fetchAssoc($res))
{
$obj_res[$counter] = $row;
#$obj_res[$counter]['ref_id'] = $object['ref_id'];
$obj_res[$counter]['obj_id'] = $object['obj_id'];
$obj_res[$counter]['type'] = $object['type'];
$obj_res[$counter]['title'] = $object['title'];
$obj_res[$counter]['child'] = $object['child'];
$obj_res[$counter]['description'] = $object['description'];
}
}
$counter++;
}
return $obj_res;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_getCountObjectsByPayMethod (   $a_id)
static

Definition at line 238 of file class.ilPaymentObject.php.

References $ilDB, $result, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjPaymentSettingsGUI\savePayMethodsObject().

{
global $ilDB;
$result = $ilDB->queryf('SELECT COUNT(pay_method) pm FROM payment_objects WHERE pay_method = %s',
array('integer'), array($a_id));
while($row = $result->fetchRow(DB_FETCHMODE_OBJECT))
{
return (int)$row->pm;
}
return 0;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_getObjectData (   $a_id)
static

Definition at line 410 of file class.ilPaymentObject.php.

References $ilDB, and $res.

Referenced by ilPurchaseBaseGUI\__addBookings(), ilObjPaymentSettingsGUI\editPriceObject(), ilPaymentStatisticGUI\editStatistic(), ilPaymentStatisticGUI\performDeleteDeassignCrs(), and ilShopGUI\showContainerContent().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM payment_objects
WHERE pobject_id = %s',
array('integer'), array($a_id));
if (is_object($res))
{
return $ilDB->fetchAssoc($res);
}
return false;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_getObjectsData (   $a_user_id)
static

Definition at line 254 of file class.ilPaymentObject.php.

References $ilDB, $in, $query, $res, $row, and ilPaymentTrustees\_getVendorsForObjects().

{
global $ilDB;
// get all vendors user is assigned to
include_once './Services/Payment/classes/class.ilPaymentTrustees.php';
include_once './Services/Payment/classes/class.ilPaymentVendors.php';
if(ilPaymentVendors::_isVendor($a_user_id))
{
$vendors[] = $a_user_id;
}
if(!count($vendors))
{
return array();
}
$data_types = array();
$data_values = array();
$cnt_vendors = count($vendors);
$query = 'SELECT * FROM payment_objects WHERE vendor_id IN';
if (is_array($vendors) &&
$cnt_vendors > 0)
{
$in = '(';
$counter = 0;
foreach($vendors as $vendor)
{
array_push($data_values, $vendor);
array_push($data_types, 'integer');
if($counter > 0) $in .= ',';
$in .= '%s';
++$counter;
}
$in .= ')';
$query .= $in;
}
$res= $ilDB->queryf($query, $data_types, $data_values);
while($row = $ilDB->fetchObject($res))
{
$objects[$row->pobject_id]['pobject_id'] = $row->pobject_id;
$objects[$row->pobject_id]['ref_id'] = $row->ref_id;
$objects[$row->pobject_id]['status'] = $row->status;
$objects[$row->pobject_id]['pay_method'] = $row->pay_method;
$objects[$row->pobject_id]['vendor_id'] = $row->vendor_id;
$objects[$row->pobject_id]['topic_id'] = $row->pt_topic_fk;
$objects[$row->pobject_id]['vat_id'] = $row->vat_id;
$objects[$row->pobject_id]['subtype'] = $row->subtype;
$objects[$row->pobject_id]['is_special'] = $row->is_special;
}
return $objects ? $objects : array();
}

+ Here is the call graph for this function:

static ilPaymentObject::_getSpecialObjects ( )
static

Definition at line 724 of file class.ilPaymentObject.php.

References $ilDB, $res, and $row.

Referenced by ilShopGUI\showSpecialContent().

{
global $ilDB;
$res = $ilDB->queryF('SELECT * FROM payment_objects
WHERE is_special = %s AND status = %s
ORDER BY pt_topic_fk',
array('integer', 'integer'), array(1,1));
$obj = array();
while($row = $ilDB->fetchAssoc($res))
{
$obj[] = $row;
}
return $obj;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_getTopicsObjects (   $topic_id = NULL)
static
Parameters
null | integer$topic_id
Returns
array

Definition at line 745 of file class.ilPaymentObject.php.

References $ilDB, $res, $row, and $topic_id.

Referenced by ilShopGUI\showTopicsContent().

{
global $ilDB;
if($topic_id === NULL)
{
$res = $ilDB->queryF('
SELECT * FROM payment_objects
WHERE status = %s
ORDER BY pt_topic_fk', array('integer'), array(1));
}
else
{
$res = $ilDB->queryF('
SELECT * FROM payment_objects
WHERE pt_topic_fk = %s AND status = %s',
array('integer', 'integer'), array((int)$topic_id, 1));
}
$obj = array();
while($row = $ilDB->fetchAssoc($res))
{
$obj[] = $row;
}
return $obj;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_hasAccess (   $a_ref_id,
  $a_transaction = 0,
  $a_subtype = '' 
)
static

Definition at line 484 of file class.ilPaymentObject.php.

References $ilDB, $ilUser, $result, $row, ilPaymentTrustees\_getVendorIdsByTrustee(), and ilPaymentBookings\_hasAccess().

Referenced by ilObjFileListGUI\getCommandFrame(), ilObjFileBasedLMListGUI\getCommandFrame(), ilObjDlBookListGUI\getCommandFrame(), ilObjSAHSLearningModuleListGUI\getCommandFrame(), ilObjLearningModuleListGUI\getCommandFrame(), ilShopResultPresentationGUI\getObjectListItem(), ilExAssignmentGUI\getOverviewBody(), and ilObjLearningModuleListGUI\getProperties().

{
include_once './Services/Payment/classes/class.ilPaymentBookings.php';
include_once './Services/Payment/classes/class.ilPaymentTrustees.php';
include_once './Services/Payment/classes/class.ilPaymentVendors.php';
global $rbacsystem,$ilDB, $ilUser;
// check write access
if($rbacsystem->checkAccess('write', $a_ref_id))
{
return true;
}
// check if user is vendor/trustee
$vendors_of_trustee = ilPaymentTrustees::_getVendorIdsByTrustee($ilUser->getId());
if(!IS_PAYMENT_ENABLED)
{
return true;
}
if($a_subtype)
{
$result = $ilDB->queryf('
SELECT * FROM payment_objects
WHERE ref_id = %s AND (status = %s or status = %s)
AND subtype = %s',
array('integer', 'integer', 'integer','text'),
array($a_ref_id, '1', '2',$a_subtype));
}
else
{
$result = $ilDB->queryf('
SELECT * FROM payment_objects
WHERE ref_id = %s
AND (status = %s OR status = %s)
OR (vendor_id = %s)',
array('integer', 'integer', 'integer','integer'),
array($a_ref_id, '1', '2',$ilUser->getId()));
}
while($row = $ilDB->fetchObject($result))
{
if($row->vendor_id == $ilUser->getId() || in_array($row->vendor_id, $vendors_of_trustee))
{
return true;
}
else
if(!ilPaymentBookings::_hasAccess($row->pobject_id, '', $a_transaction))
{
return false;
}
else
{
return true;
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilPaymentObject::_hasExtensions (   $a_ref_id)
static

Definition at line 648 of file class.ilPaymentObject.php.

References $ilDB, $res, and $row.

Referenced by ilObjectListGUI\insertPayment().

{
global $ilDB;
// user has already access to current object
// object contain buyable extension-prices
$res = $ilDB->queryf('
SELECT * FROM payment_prices pp, payment_objects po
WHERE po.ref_id = %s
AND pp.pobject_id = po.pobject_id
AND pp.extension = %s',
array('integer', 'integer'), array($a_ref_id, 1));
if($row = $ilDB->numRows($res))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_isBuyable (   $a_ref_id,
  $a_subtype = '' 
)
static

Definition at line 543 of file class.ilPaymentObject.php.

References $ilDB, $result, and $row.

Referenced by ilRepUtil\deleteObjects(), ilObjFileListGUI\getCommandFrame(), ilObjFileBasedLMListGUI\getCommandFrame(), ilObjDlBookListGUI\getCommandFrame(), ilObjSAHSLearningModuleListGUI\getCommandFrame(), ilObjLearningModuleListGUI\getCommandFrame(), ilExAssignmentGUI\getOverviewBody(), ilObjLearningModuleListGUI\getProperties(), and ilShopGUI\showContainerContent().

{
global $ilDB;
if(!IS_PAYMENT_ENABLED)
{
return false;
}
if($a_subtype)
{
$result = $ilDB->queryf('
SELECT * FROM payment_objects
WHERE ref_id = %s
AND (status = %s or status = %s)
AND subtype = %s',
array('integer', 'integer', 'integer','text'),
array($a_ref_id, '1', '2',$a_subtype));
}
else
{
$result = $ilDB->queryf('
SELECT * FROM payment_objects
WHERE ref_id = %s AND (status = %s or status = %s)',
array('integer', 'integer', 'integer'),
array($a_ref_id, '1', '2'));
}
while($row = $ilDB->fetchObject($result))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_isInCart (   $a_ref_id)
static

Definition at line 616 of file class.ilPaymentObject.php.

References $ilDB, $ilUser, $result, and $row.

Referenced by ilObjLearningModuleListGUI\getProperties().

{
global $ilDB, $ilUser;
if(ANONYMOUS_USER_ID == $ilUser->getId())
{
$result = $ilDB->queryf('
SELECT psc_id FROM payment_objects po, payment_shopping_cart psc
WHERE ref_id = %s
AND session_id = %s
AND po.pobject_id = psc.pobject_id',
array('integer', 'text'),
array($a_ref_id, session_id()));
}
else
{
$result = $ilDB->queryf('
SELECT psc_id FROM payment_objects po, payment_shopping_cart psc
WHERE ref_id = %s
AND customer_id = %s
AND po.pobject_id = psc.pobject_id',
array('integer', 'integer'),
array($a_ref_id, $ilUser->getId()));
}
while($row = $ilDB->fetchObject($result))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_isNewObject (   $a_ref_id)
static

Definition at line 580 of file class.ilPaymentObject.php.

References $ilDB, and $res.

Referenced by ilPaymentObjectSelector\isNodeClickable().

{
global $ilDB;
$res = $ilDB->queryF('SELECT * FROM payment_objects WHERE ref_id = %s',
array('integer'), array($a_ref_id));
$rows = $ilDB->numRows($res);
return $rows ? false : true;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_isPurchasable (   $a_ref_id,
  $a_vendor_id = 0,
  $a_check_trustee = false,
  $a_check_status = false 
)
static

Definition at line 428 of file class.ilPaymentObject.php.

References $ilDB, $query, $res, and ilPaymentTrustees\_getVendorsForObjects().

Referenced by ilPaymentObjectGUI\addObject(), and ilPaymentObjectSelector\isNodeClickable().

{
global $ilDB;
// In the moment it's not possible to sell one object twice
$data = array();
$data_types = array();
$query = 'SELECT * FROM payment_objects WHERE ref_id = %s ';
$data_types[] = 'integer';
$data[]= $a_ref_id;
// check if object is buyable !!
if($a_check_status)
{
$query .= 'AND status > %s ';
$data_types[] = 'integer';
$data[] = 0;
}
if ($a_vendor_id > 0)
{
$query .= 'AND vendor_id = %s';
$data_types[] = 'integer';
$data[] = $a_vendor_id;
if($a_check_trustee)
{
include_once './Services/Payment/classes/class.ilPaymentTrustees.php';
include_once './Services/Payment/classes/class.ilPaymentVendors.php';
$vendors = ilPaymentTrustees::_getVendorsForObjects($a_vendor_id);
// @todo $a_user_id not defined?!?!
if(ilPaymentVendors::_isVendor($a_user_id))
{
$vendors[] = $a_user_id;
}
if(is_array($vendors) && count($vendors))
{
$query .= ' OR '.$ilDB->in('vendor_id', $vendors, false, 'integer');
}
}
}
$res = $ilDB->queryf($query, $data_types, $data);
$rows = $ilDB->numRows($res);
return $rows ? true : false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilPaymentObject::_lookupPobjectId (   $a_ref_id)
static

Definition at line 199 of file class.ilPaymentObject.php.

References $ilDB, $res, and $row.

Referenced by ilShopPurchaseGUI\__initPaymentObject(), ilPaymentStatisticGUI\addCustomer(), ilObjPaymentSettingsGUI\addCustomerObject(), ilShopResultPresentationGUI\getObjectListItem(), ilObjectListGUI\insertPayment(), ilShopResultPresentationGUI\renderItems(), ilObjPaymentSettingsGUI\saveCustomerObject(), and ilShopGUI\showContainerContent().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM payment_objects
WHERE ref_id = %s',
array('integer'),
array($a_ref_id));
while($row = $ilDB->fetchAssoc($res))
{
return $row['pobject_id'];
}
return 0;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_lookupTopicId (   $a_ref_id)
static

Definition at line 216 of file class.ilPaymentObject.php.

References $ilDB, $result, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilShopSearchResult\filter(), and ilShopSearchResult\getResultsForPresentation().

{
global $ilDB;
static $cache = array();
if(isset($cache[$a_ref_id]))
{
return $cache[$a_ref_id];
}
$result = $ilDB->queryf('SELECT pt_topic_fk FROM payment_objects WHERE ref_id = %s',
array('integer'),array($a_ref_id));
while($row = $result->fetchRow(DB_FETCHMODE_OBJECT))
{
$cache[$a_ref_id] = $row->pt_topic_fk;
return (int)$cache[$a_ref_id];
}
return 0;
}

+ Here is the caller graph for this function:

static ilPaymentObject::_requiresPurchaseToAccess (   $a_ref_id,
  $a_purchasetype = '' 
)
static

this function should be used by all buyable repository objects !!

Parameters
<integer>$a_ref_id
<text>$a_purchasetype ('buy', 'demo')
Returns
<bool>

Definition at line 600 of file class.ilPaymentObject.php.

Referenced by ilObjFileGUI\executeCommand(), ilSAHSPresentationGUI\executeCommand(), ilObjFileBasedLMGUI\executeCommand(), ilObjTestGUI\executeCommand(), ilGlossaryPresentationGUI\executeCommand(), ilObjCourseGUI\executeCommand(), ilLMPresentationGUI\ilLMPresentationGUI(), ilLMTOCExplorerGUI\isNodeClickable(), and ilObjContentObjectGUI\setilLMMenu().

{
/* Check:
* - User has no Access -> return false
* - User has Access but there are also Extension-Prices available -> User is able to buy the Object AGAIN to extend duration
*/
if( (self::_isBuyable($a_ref_id) && !self::_hasAccess($a_ref_id))
|| (self::_isBuyable($a_ref_id) && self::_hasAccess($a_ref_id)
&& self::_hasExtensions($a_ref_id) && isset($a_purchasetype)))
{
return true;
}
else return false;
}

+ Here is the caller graph for this function:

ilPaymentObject::add ( )

Definition at line 141 of file class.ilPaymentObject.php.

References getPayMethod(), getRefId(), getSpecial(), getStatus(), getSubtype(), getTopicId(), getVatId(), and getVendorId().

{
$next_id = $this->db->nextId('payment_objects');
$this->db->insert('payment_objects',array(
'pobject_id' => array('integer', $next_id),
'ref_id' => array('integer', $this->getRefId()),
'status' => array('integer', $this->getStatus()),
'pay_method' => array('integer', $this->getPayMethod()),
'vendor_id' => array('integer', $this->getVendorId()),
'pt_topic_fk' => array('integer', $this->getTopicId()),
'vat_id' => array('integer', $this->getVatId()),
'subtype' => array('text', $this->getSubtype()),
'is_special' => array('integer', $this->getSpecial())
));
return $next_id;
}

+ Here is the call graph for this function:

ilPaymentObject::delete ( )

Definition at line 159 of file class.ilPaymentObject.php.

References getPobjectId().

{
if($this->getPobjectId())
{
include_once 'Services/Payment/classes/class.ilFileDataShop.php';
$oFileData = new ilFileDataShop($this->getPobjectId());
$oFileData->deassignFileFromPaymentObject();
$statement = $this->db->manipulateF('DELETE FROM payment_objects WHERE pobject_id = %s',
array('integer'), array($this->getPobjectId()));
return true;
}
return false;
}

+ Here is the call graph for this function:

static ilPaymentObject::getAllBuyableObjects ( )
static

Definition at line 708 of file class.ilPaymentObject.php.

References $ilDB, $res, and $row.

{
global $ilDB;
$res = $ilDB->queryF('SELECT ref_id FROM payment_objects WHERE status = %s',
array('integer'), array(1));
$obj = array();
while($row = $ilDB->fetchAssoc($res))
{
$obj[] = $row['ref_id'];
}
return $obj;
}
ilPaymentObject::getPayMethod ( )

Definition at line 87 of file class.ilPaymentObject.php.

References $pay_method.

Referenced by add(), and update().

{
}

+ Here is the caller graph for this function:

ilPaymentObject::getPobjectId ( )

Definition at line 63 of file class.ilPaymentObject.php.

References $pobject_id.

Referenced by __read(), delete(), and update().

{
}

+ Here is the caller graph for this function:

ilPaymentObject::getRefId ( )

Definition at line 71 of file class.ilPaymentObject.php.

References $ref_id.

Referenced by add(), and update().

{
return $this->ref_id;
}

+ Here is the caller graph for this function:

ilPaymentObject::getSpecial ( )

Definition at line 121 of file class.ilPaymentObject.php.

References $is_special.

Referenced by add(), and update().

{
}

+ Here is the caller graph for this function:

ilPaymentObject::getStatus ( )

Definition at line 79 of file class.ilPaymentObject.php.

References $status.

Referenced by add(), and update().

{
return $this->status;
}

+ Here is the caller graph for this function:

ilPaymentObject::getSubtype ( )

Definition at line 113 of file class.ilPaymentObject.php.

References $subtype.

Referenced by add(), and update().

{
}

+ Here is the caller graph for this function:

ilPaymentObject::getTopicId ( )

Definition at line 55 of file class.ilPaymentObject.php.

References $topic_id.

Referenced by add(), and update().

{
}

+ Here is the caller graph for this function:

ilPaymentObject::getVat (   $a_amount = 0,
  $type = 'CALCULATION' 
)

Definition at line 126 of file class.ilPaymentObject.php.

References ilShopUtils\_formatFloat(), and getVatId().

{
$oVAT = new ilShopVats($this->getVatId());
switch($type)
{
case 'CALCULATION':
$val = (float)($a_amount - (round(($a_amount / (1 + ($oVAT->getRate() / 100))) * 100) / 100));
return number_format((float)$val,'2','.','');
default:
$val = (float)($a_amount - (round(($a_amount / (1 + ($oVAT->getRate() / 100))) * 100) / 100));
return $val;
}
}

+ Here is the call graph for this function:

ilPaymentObject::getVatId ( )

Definition at line 99 of file class.ilPaymentObject.php.

References $vat_id.

Referenced by add(), getVat(), and update().

{
return $this->vat_id;
}

+ Here is the caller graph for this function:

ilPaymentObject::getVendorId ( )

Definition at line 95 of file class.ilPaymentObject.php.

References $vendor_id.

Referenced by add(), and update().

{
}

+ Here is the caller graph for this function:

ilPaymentObject::setPayMethod (   $a_method)

Definition at line 83 of file class.ilPaymentObject.php.

Referenced by __read().

{
$this->pay_method = $a_method;
}

+ Here is the caller graph for this function:

ilPaymentObject::setRefId (   $a_ref_id)

Definition at line 67 of file class.ilPaymentObject.php.

Referenced by __read().

{
$this->ref_id = $a_ref_id;
}

+ Here is the caller graph for this function:

ilPaymentObject::setSpecial (   $a_special)

Definition at line 117 of file class.ilPaymentObject.php.

Referenced by __read().

{
$this->is_special = $a_special;
}

+ Here is the caller graph for this function:

ilPaymentObject::setStatus (   $a_status)

Definition at line 75 of file class.ilPaymentObject.php.

Referenced by __read().

{
$this->status = $a_status;
}

+ Here is the caller graph for this function:

ilPaymentObject::setSubtype (   $a_subtype)

Definition at line 108 of file class.ilPaymentObject.php.

Referenced by __read().

{
$this->subtype = $a_subtype;
}

+ Here is the caller graph for this function:

ilPaymentObject::setTopicId (   $a_topic_id)

Definition at line 59 of file class.ilPaymentObject.php.

Referenced by __read().

{
$this->topic_id = $a_topic_id;
}

+ Here is the caller graph for this function:

ilPaymentObject::setVatId (   $a_vat_id)

Definition at line 103 of file class.ilPaymentObject.php.

Referenced by __read().

{
$this->vat_id = $a_vat_id;
}

+ Here is the caller graph for this function:

ilPaymentObject::setVendorId (   $a_vendor_id)

Definition at line 91 of file class.ilPaymentObject.php.

Referenced by __read().

{
$this->vendor_id = $a_vendor_id;
}

+ Here is the caller graph for this function:

ilPaymentObject::update ( )

Definition at line 177 of file class.ilPaymentObject.php.

References getPayMethod(), getPobjectId(), getRefId(), getSpecial(), getStatus(), getSubtype(), getTopicId(), getVatId(), and getVendorId().

{
if((int)$this->getPobjectId())
{
$this->db->update('payment_objects',array(
'ref_id' => array('integer', $this->getRefId()),
'status' => array('integer', $this->getStatus()),
'pay_method' => array('integer', $this->getPayMethod()),
'vendor_id' => array('integer', $this->getVendorId()),
'pt_topic_fk' => array('integer', $this->getTopicId()),
'vat_id' => array('integer', $this->getVatId()),
'subtype' => array('text', $this->getSubtype()),
'is_special' => array('integer', $this->getSpecial())
),
array('pobject_id' => array('integer', $this->getPobjectId())));
return true;
}
else
return false;
}

+ Here is the call graph for this function:

Field Documentation

ilPaymentObject::$db = null
private

Definition at line 14 of file class.ilPaymentObject.php.

ilPaymentObject::$is_special = 0
private

Definition at line 24 of file class.ilPaymentObject.php.

Referenced by getSpecial().

ilPaymentObject::$pay_method = null
private

Definition at line 19 of file class.ilPaymentObject.php.

Referenced by getPayMethod().

ilPaymentObject::$pobject_id = null
private

Definition at line 16 of file class.ilPaymentObject.php.

Referenced by getPobjectId().

ilPaymentObject::$ref_id = null
private

Definition at line 17 of file class.ilPaymentObject.php.

Referenced by getRefId().

ilPaymentObject::$status = null
private

Definition at line 18 of file class.ilPaymentObject.php.

Referenced by getStatus().

ilPaymentObject::$subtype = null
private

Definition at line 23 of file class.ilPaymentObject.php.

Referenced by getSubtype().

ilPaymentObject::$topic_id = 0
private

Definition at line 21 of file class.ilPaymentObject.php.

Referenced by _getTopicsObjects(), and getTopicId().

ilPaymentObject::$user_obj = null
private

Definition at line 15 of file class.ilPaymentObject.php.

Referenced by __construct().

ilPaymentObject::$vat_id = 0
private

Definition at line 22 of file class.ilPaymentObject.php.

Referenced by getVatId().

ilPaymentObject::$vendor_id = null
private

Definition at line 20 of file class.ilPaymentObject.php.

Referenced by getVendorId().


The documentation for this class was generated from the following file: