Open Journal Systems  3.3.0
OJSCompletedPaymentDAO Class Reference
Inheritance diagram for OJSCompletedPaymentDAO:
DAO

Public Member Functions

 _fromRow ($row)
 
 getByAssoc ($userId=null, $paymentType=null, $assocId=null)
 
 getByContextId ($contextId, $rangeInfo=null)
 
 getById ($completedPaymentId, $contextId=null)
 
 getByUserId ($userId, $rangeInfo=null)
 
 getInsertId ()
 
 hasPaidPublication ($userId, $articleId)
 
 hasPaidPurchaseArticle ($userId, $articleId)
 
 hasPaidPurchaseIssue ($userId, $issueId)
 
 insertObject ($completedPayment)
 
 newDataObject ()
 
 updateObject ($completedPayment)
 
- Public Member Functions inherited from DAO
 __construct ($dataSource=null, $callHooks=true)
 
 concat ()
 
 convertFromDB ($value, $type)
 
 convertToDB ($value, &$type)
 
 dateFromDB ($d)
 
 datetimeFromDB ($dt)
 
 datetimeToDB ($dt)
 
 dateToDB ($d)
 
 flushCache ()
 
 formatDateToDB ($date, $defaultNumWeeks=null, $acceptPastDate=true)
 
 getAdditionalFieldNames ()
 
 getAffectedRows ()
 
 getDataObjectSettings ($tableName, $idFieldName, $idFieldValue, $dataObject)
 
 getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getLocaleFieldNames ()
 
 getType ($value)
 
 handleError ($dataSource, $sql)
 
 nullOrInt ($value)
 
 replace ($table, $arrFields, $keyCols)
 
retrieve ($sql, $params=false, $callHooks=true)
 
retrieveCached ($sql, $params=false, $secsToCache=3600, $callHooks=true)
 
retrieveLimit ($sql, $params=false, $numRows=false, $offset=false, $callHooks=true)
 
retrieveRange ($sql, $params=false, $dbResultRange=null, $callHooks=true)
 
 setCacheDir ()
 
 setDataSource ($dataSource)
 
 update ($sql, $params=false, $callHooks=true, $dieOnError=true)
 
 updateDataObjectSettings ($tableName, $dataObject, $idArray)
 

Additional Inherited Members

- Static Public Member Functions inherited from DAO
static getDataChangedEvent ($elementId=null, $parentElementId=null, $content='')
 
- Data Fields inherited from DAO
 $_dataSource
 
- Protected Member Functions inherited from DAO
 _getInsertId ($table='', $id='')
 

Detailed Description

Operations for retrieving and querying past payments.

See also
OJSCompletedPayment, Payment

Definition at line 20 of file OJSCompletedPaymentDAO.inc.php.

Member Function Documentation

◆ _fromRow()

OJSCompletedPaymentDAO::_fromRow (   $row)

Internal function to return a CompletedPayment object from a row.

Parameters
$rowarray
Returns
CompletedPayment

Definition at line 220 of file OJSCompletedPaymentDAO.inc.php.

References DAO\datetimeFromDB(), and newDataObject().

Referenced by getByAssoc(), getByContextId(), and getById().

◆ getByAssoc()

OJSCompletedPaymentDAO::getByAssoc (   $userId = null,
  $paymentType = null,
  $assocId = null 
)

Get a payment by assoc info

Parameters
$userIdint
$paymentTypeint PAYMENT_TYPE_...
$assocIdint
Returns
CompletedPayment|null

Definition at line 121 of file OJSCompletedPaymentDAO.inc.php.

References _fromRow(), and DAO\retrieve().

Referenced by hasPaidPublication(), hasPaidPurchaseArticle(), and hasPaidPurchaseIssue().

◆ getByContextId()

OJSCompletedPaymentDAO::getByContextId (   $contextId,
  $rangeInfo = null 
)

Retrieve an array of payments for a particular context ID.

Parameters
$contextIdint
Returns
array Matching payments

Definition at line 175 of file OJSCompletedPaymentDAO.inc.php.

References _fromRow(), and DAO\retrieveRange().

◆ getById()

OJSCompletedPaymentDAO::getById (   $completedPaymentId,
  $contextId = null 
)

Retrieve a CompletedPayment by its ID.

Parameters
$completedPaymentIdint
$contextIdint optional
Returns
CompletedPayment

Definition at line 27 of file OJSCompletedPaymentDAO.inc.php.

References _fromRow(), and DAO\retrieve().

◆ getByUserId()

OJSCompletedPaymentDAO::getByUserId (   $userId,
  $rangeInfo = null 
)

Retrieve CompletedPayments by user ID

Parameters
$userIdint User ID
$rangeInfoDBResultRange Optional
Returns
object DAOResultFactory containing matching CompletedPayment objects

Definition at line 197 of file OJSCompletedPaymentDAO.inc.php.

References DAO\retrieveRange().

◆ getInsertId()

OJSCompletedPaymentDAO::getInsertId ( )

Get the ID of the last inserted completed payment.

Returns
int

Definition at line 110 of file OJSCompletedPaymentDAO.inc.php.

References DAO\_getInsertId().

Referenced by insertObject().

◆ hasPaidPublication()

OJSCompletedPaymentDAO::hasPaidPublication (   $userId,
  $articleId 
)

Look for a completed PAYMENT_TYPE_PUBLICATION payment matching the user and article IDs

Parameters
int$userId
int$articleId

Definition at line 166 of file OJSCompletedPaymentDAO.inc.php.

References getByAssoc().

◆ hasPaidPurchaseArticle()

OJSCompletedPaymentDAO::hasPaidPurchaseArticle (   $userId,
  $articleId 
)

Look for a completed PAYMENT_TYPE_PURCHASE_ARTICLE payment matching the article ID

Parameters
$userIdint
$articleIdint

Definition at line 148 of file OJSCompletedPaymentDAO.inc.php.

References getByAssoc().

◆ hasPaidPurchaseIssue()

OJSCompletedPaymentDAO::hasPaidPurchaseIssue (   $userId,
  $issueId 
)

Look for a completed PAYMENT_TYPE_PURCHASE_ISSUE payment matching the user and issue IDs

Parameters
int$userId
int$issueId

Definition at line 157 of file OJSCompletedPaymentDAO.inc.php.

References getByAssoc().

◆ insertObject()

OJSCompletedPaymentDAO::insertObject (   $completedPayment)

Insert a new completed payment.

Parameters
$completedPaymentCompletedPayment

Definition at line 49 of file OJSCompletedPaymentDAO.inc.php.

References DAO\datetimeToDB(), Core\getCurrentDate(), getInsertId(), and DAO\update().

◆ newDataObject()

OJSCompletedPaymentDAO::newDataObject ( )

Return a new data object.

Returns
CompletedPayment

Definition at line 211 of file OJSCompletedPaymentDAO.inc.php.

Referenced by _fromRow().

◆ updateObject()

OJSCompletedPaymentDAO::updateObject (   $completedPayment)

Update an existing completed payment.

Parameters
$completedPaymentCompletedPayment
Returns
boolean

Definition at line 75 of file OJSCompletedPaymentDAO.inc.php.

References DAO\datetimeToDB(), and DAO\update().


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