Public Member Functions | |
ilPaymentObject (&$user_obj, $a_pobject_id=null) | |
getPobjectId () | |
setRefId ($a_ref_id) | |
getRefId () | |
setStatus ($a_status) | |
getStatus () | |
setPayMethod ($a_method) | |
getPayMethod () | |
setVendorId ($a_vendor_id) | |
getVendorId () | |
add () | |
delete () | |
update () | |
_lookupPobjectId ($a_ref_id) | |
_getCountObjectsByPayMethod ($a_type) | |
_getAllObjectsData () | |
_getObjectsData ($a_user_id) | |
_isPurchasable ($a_ref_id) | |
_hasAccess ($a_ref_id) | |
_getActivation ($a_ref_id) | |
_isBuyable ($a_ref_id) | |
__read () | |
Data Fields | |
$db = null | |
$user_obj = null | |
$pobject_id = null | |
$ref_id = null | |
$status = null | |
$pay_method = null | |
$vendor_id = null |
Definition at line 33 of file class.ilPaymentObject.php.
ilPaymentObject::__read | ( | ) |
Definition at line 317 of file class.ilPaymentObject.php.
References $query, $res, $row, getPobjectId(), setPayMethod(), setRefId(), setStatus(), and setVendorId().
Referenced by ilPaymentObject().
{ if($this->getPobjectId()) { $query = "SELECT * FROM payment_objects ". "WHERE pobject_id = '".$this->getPobjectId()."'"; $res = $this->db->query($query); while($row =& $res->fetchRow(DB_FETCHMODE_OBJECT)) { $this->setRefId($row->ref_id); $this->setStatus($row->status); $this->setPayMethod($row->pay_method); $this->setVendorId($row->vendor_id); return true; } } return false; }
ilPaymentObject::_getActivation | ( | $ | a_ref_id | ) |
Definition at line 286 of file class.ilPaymentObject.php.
References $query, $rbacsystem, $res, and $row.
Referenced by ilCourseContentInterface::cci_view().
{ include_once './payment/classes/class.ilPaymentBookings.php'; global $rbacsystem,$ilDB; $query = "SELECT * FROM payment_objects ". "WHERE ref_id = '".$a_ref_id."' ". "AND (status = '1' OR status = '2')"; $res = $ilDB->query($query); $row = $res->fetchRow(DB_FETCHMODE_OBJECT); return ilPaymentBookings::_getActivation($row->pobject_id); }
ilPaymentObject::_getAllObjectsData | ( | ) |
Definition at line 201 of file class.ilPaymentObject.php.
{ ; }
ilPaymentObject::_getCountObjectsByPayMethod | ( | $ | a_type | ) |
Definition at line 169 of file class.ilPaymentObject.php.
References $query, $res, and $row.
Referenced by ilObjPaymentSettingsGUI::savePayMethodsObject().
{ global $ilDB; switch($a_type) { case 'pm_bill': $pm = 1; break; case 'pm_bmf': $pm = 2; break; default: $pm = -1; } $query = 'SELECT count(pay_method) as pm FROM payment_objects '. "WHERE pay_method = '".$pm."'"; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { return $row->pm; } return 0; }
ilPaymentObject::_getObjectsData | ( | $ | a_user_id | ) |
Definition at line 206 of file class.ilPaymentObject.php.
References $query, $res, $row, ilPaymentTrustees::_getVendorsForObjects(), and ilPaymentVendors::_isVendor().
Referenced by ilPaymentObjectGUI::showObjects().
{ global $ilDB; // get all vendors user is assigned to include_once './payment/classes/class.ilPaymentTrustees.php'; include_once './payment/classes/class.ilPaymentVendors.php'; $vendors = ilPaymentTrustees::_getVendorsForObjects($a_user_id); if(ilPaymentVendors::_isVendor($a_user_id)) { $vendors[] = $a_user_id; } if(!count($vendors)) { return array(); } $in = " IN ('"; $in .= implode("','",$vendors); $in .= "')"; $query = "SELECT * FROM payment_objects ". "WHERE vendor_id ".$in; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { $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; } return $objects ? $objects : array(); }
ilPaymentObject::_hasAccess | ( | $ | a_ref_id | ) |
Definition at line 260 of file class.ilPaymentObject.php.
References $query, $rbacsystem, $res, $row, and ilPaymentBookings::_hasAccess().
Referenced by ilSearch::_checkParentConditions(), ilRepositoryGUI::executeAdminCommand(), ilObjCourseGUI::executeCommand(), and ilRepositoryGUI::showLearningResources().
{ include_once './payment/classes/class.ilPaymentBookings.php'; global $rbacsystem,$ilDB; // check write access if($rbacsystem->checkAccess('write',$a_ref_id)) { return true; } $query = "SELECT * FROM payment_objects ". "WHERE ref_id = '".$a_ref_id."' ". "AND (status = '1' OR status = '2')"; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { if(!ilPaymentBookings::_hasAccess($row->pobject_id)) { return false; } } return true; }
ilPaymentObject::_isBuyable | ( | $ | a_ref_id | ) |
Definition at line 300 of file class.ilPaymentObject.php.
References $query, $res, and $row.
Referenced by ilCourseContentInterface::cci_view(), ilObjectGUI::confirmedDeleteObject(), ilRepositoryGUI::showCourses(), ilRepositoryGUI::showFiles(), ilRepositoryGUI::showLearningResources(), and ilRepositoryGUI::showTests().
{ global $ilDB; $query = "SELECT * FROM payment_objects ". "WHERE ref_id = '".$a_ref_id."' ". "AND (status = 1 or status = 2)"; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { return true; } return false; }
ilPaymentObject::_isPurchasable | ( | $ | a_ref_id | ) |
Definition at line 244 of file class.ilPaymentObject.php.
Referenced by ilPaymentObjectGUI::addObject(), ilPaymentObjectSelector::isClickable(), and ilPaymentObjectSelector::showChilds().
{ global $ilDB; // In the moment it's not possible to sell one object twice $query = "SELECT * FROM payment_objects ". "WHERE ref_id = '".$a_ref_id."'"; #"AND status = '1' OR status = '3' "; $res = $ilDB->query($query); return $res->numRows() ? false : true; }
ilPaymentObject::_lookupPobjectId | ( | $ | a_ref_id | ) |
Definition at line 154 of file class.ilPaymentObject.php.
References $query, $res, and $row.
Referenced by ilPaymentPurchaseGUI::__initPaymentObject().
{ global $ilDB; $query = "SELECT * FROM payment_objects ". "WHERE ref_id = '".$a_ref_id."'"; $res = $ilDB->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { return $row->pobject_id; } return 0; }
ilPaymentObject::add | ( | ) |
Definition at line 106 of file class.ilPaymentObject.php.
References $query, $res, $row, getPayMethod(), getRefId(), getStatus(), and getVendorId().
{ $query = "INSERT INTO payment_objects ". "VALUES('','". $this->getRefId()."','". $this->getStatus()."',' ". $this->getPayMethod()."',' ". $this->getVendorId()."')"; $this->db->query($query); $query = "SELECT LAST_INSERT_ID() as new_id"; $res = $this->db->query($query); while($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) { return $row->new_id; } return false; }
ilPaymentObject::delete | ( | ) |
Definition at line 126 of file class.ilPaymentObject.php.
References $query, and getPobjectId().
{ if($this->getPobjectId()) { $query = "DELETE FROM payment_objects ". "WHERE pobject_id = '".$this->getPobjectId()."'"; $this->db->query($query); return true; } return false; }
ilPaymentObject::getPayMethod | ( | ) |
Definition at line 90 of file class.ilPaymentObject.php.
Referenced by add().
{
return $this->pay_method;
}
ilPaymentObject::getPobjectId | ( | ) |
Definition at line 65 of file class.ilPaymentObject.php.
Referenced by __read(), and delete().
{
return $this->pobject_id;
}
ilPaymentObject::getRefId | ( | ) |
Definition at line 74 of file class.ilPaymentObject.php.
Referenced by add().
{
return $this->ref_id;
}
ilPaymentObject::getStatus | ( | ) |
Definition at line 82 of file class.ilPaymentObject.php.
Referenced by add().
{
return $this->status;
}
ilPaymentObject::getVendorId | ( | ) |
Definition at line 98 of file class.ilPaymentObject.php.
Referenced by add().
{
return $this->vendor_id;
}
ilPaymentObject::ilPaymentObject | ( | &$ | user_obj, | |
$ | a_pobject_id = null | |||
) |
Definition at line 44 of file class.ilPaymentObject.php.
References $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->PAY_METHOD_BILL = 1; $this->PAY_METHOD_BMF = 2; $this->pobject_id = $a_pobject_id; $this->__read(); }
ilPaymentObject::setPayMethod | ( | $ | a_method | ) |
Definition at line 86 of file class.ilPaymentObject.php.
Referenced by __read().
{ $this->pay_method = $a_method; }
ilPaymentObject::setRefId | ( | $ | a_ref_id | ) |
Definition at line 70 of file class.ilPaymentObject.php.
Referenced by __read().
{ $this->ref_id = $a_ref_id; }
ilPaymentObject::setStatus | ( | $ | a_status | ) |
Definition at line 78 of file class.ilPaymentObject.php.
Referenced by __read().
{ $this->status = $a_status; }
ilPaymentObject::setVendorId | ( | $ | a_vendor_id | ) |
Definition at line 94 of file class.ilPaymentObject.php.
Referenced by __read().
{ $this->vendor_id= $a_vendor_id; }
ilPaymentObject::update | ( | ) |
Definition at line 140 of file class.ilPaymentObject.php.
References $query.
ilPaymentObject::$db = null |
Definition at line 35 of file class.ilPaymentObject.php.
ilPaymentObject::$pay_method = null |
Definition at line 41 of file class.ilPaymentObject.php.
ilPaymentObject::$pobject_id = null |
Definition at line 37 of file class.ilPaymentObject.php.
ilPaymentObject::$ref_id = null |
Definition at line 39 of file class.ilPaymentObject.php.
ilPaymentObject::$status = null |
Definition at line 40 of file class.ilPaymentObject.php.
ilPaymentObject::$user_obj = null |
Definition at line 36 of file class.ilPaymentObject.php.
Referenced by ilPaymentObject().
ilPaymentObject::$vendor_id = null |
Definition at line 42 of file class.ilPaymentObject.php.