Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
PKPGiftDAO Class Reference
Inheritance diagram for PKPGiftDAO:
DAO GiftDAO

Public Member Functions

_returnGiftFromRow (&$row)
 
 deleteGiftById ($giftId)
 
 deleteGiftsByAssocId ($assocType, $assocId)
 
 deleteObject ($gift)
 
getAllGiftsByRecipient ($assocType, $userId, $rangeInfo=null)
 
getGift ($giftId)
 
 getGiftAssocId ($giftId)
 
 getGiftAssocType ($giftId)
 
getGiftsByAssocId ($assocType, $assocId, $rangeInfo=null)
 
getGiftsByRecipient ($assocType, $assocId, $userId, $rangeInfo=null)
 
getGiftsByTypeAndRecipient ($assocType, $assocId, $giftType, $userId, $rangeInfo=null)
 
 getInsertGiftId ()
 
getNotRedeemedGiftsByRecipient ($assocType, $assocId, $userId, $rangeInfo=null)
 
getNotRedeemedGiftsByTypeAndRecipient ($assocType, $assocId, $giftType, $userId, $rangeInfo=null)
 
 insertObject (&$gift)
 
 PKPGiftDAO ()
 
 recipientHasGift ($assocType, $assocId, $userId, $giftId)
 
 recipientHasNotRedeemedGift ($assocType, $assocId, $userId, $giftId)
 
 redeemGift ($assocType, $assocId, $userId, $giftId)
 
 updateObject (&$gift)
 
- Public Member Functions inherited from DAO
 concat ()
 
 convertFromDB ($value, $type)
 
 convertToDB ($value, &$type)
 
 DAO ($dataSource=null, $callHooks=true)
 
 dateFromDB ($d)
 
 datetimeFromDB ($dt)
 
 datetimeToDB ($dt)
 
 dateToDB ($d)
 
 flushCache ()
 
 formatDateToDB ($date, $defaultNumWeeks=null, $acceptPastDate=true)
 
 getAffectedRows ()
 
 getDataChangedEvent ($elementId=null, $parentElementId=null)
 
getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getInsertId ($table= '', $id= '', $callHooks=true)
 
 getType ($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

- Public Attributes inherited from DAO
 $_dataSource
 

Detailed Description

Operations for retrieving and modifying Gift objects.

See Also
Gift, PKPGift

Definition at line 25 of file PKPGiftDAO.inc.php.

Member Function Documentation

& PKPGiftDAO::_returnGiftFromRow ( $row)

Internal function to return a Gift object from a row.

Parameters
$rowarray
Returns
Gift object

Definition at line 82 of file PKPGiftDAO.inc.php.

References HookRegistry\call(), and DAO\datetimeFromDB().

Referenced by getGift().

PKPGiftDAO::deleteGiftById (   $giftId)

Delete a gift by gift ID.

Parameters
$giftIdint
Returns
boolean

Definition at line 239 of file PKPGiftDAO.inc.php.

References DAO\update().

Referenced by deleteGiftsByAssocId(), and deleteObject().

PKPGiftDAO::deleteGiftsByAssocId (   $assocType,
  $assocId 
)

Delete gifts by assoc ID

Parameters
$assocTypeint
$assocIdint

Definition at line 248 of file PKPGiftDAO.inc.php.

References deleteGiftById(), and getGiftsByAssocId().

PKPGiftDAO::deleteObject (   $gift)

Delete a gift.

Parameters
$giftGift
Returns
boolean

Definition at line 230 of file PKPGiftDAO.inc.php.

References deleteGiftById().

& PKPGiftDAO::getAllGiftsByRecipient (   $assocType,
  $userId,
  $rangeInfo = null 
)

Retrieve an array of all gifts for a recipient user.

Parameters
$assocTypeint
$userIdint
Returns
object DAOResultFactory containing matching Gifts

Definition at line 360 of file PKPGiftDAO.inc.php.

References DAO\retrieveRange().

& PKPGiftDAO::getGift (   $giftId)

Retrieve a gift by gift ID.

Parameters
$giftIdint
Returns
Gift object

Definition at line 38 of file PKPGiftDAO.inc.php.

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

Referenced by GiftDAO\redeemGift().

PKPGiftDAO::getGiftAssocId (   $giftId)

Retrieve gift assoc ID by gift ID.

Parameters
$giftIdint
Returns
int

Definition at line 56 of file PKPGiftDAO.inc.php.

References DAO\retrieve().

PKPGiftDAO::getGiftAssocType (   $giftId)

Retrieve gift assoc type by gift ID.

Parameters
$giftIdint
Returns
int

Definition at line 69 of file PKPGiftDAO.inc.php.

References DAO\retrieve().

& PKPGiftDAO::getGiftsByAssocId (   $assocType,
  $assocId,
  $rangeInfo = null 
)

Retrieve an array of gifts matching a particular assoc ID.

Parameters
$assocTypeint
$assocIdint
Returns
object DAOResultFactory containing matching Gifts

Definition at line 263 of file PKPGiftDAO.inc.php.

References DAO\retrieveRange().

Referenced by deleteGiftsByAssocId().

& PKPGiftDAO::getGiftsByRecipient (   $assocType,
  $assocId,
  $userId,
  $rangeInfo = null 
)

Retrieve an array of redeemed and unredeemed gifts for a recipient user.

Parameters
$assocTypeint
$assocIdint
$userIdint
Returns
object DAOResultFactory containing matching Gifts

Definition at line 385 of file PKPGiftDAO.inc.php.

References DAO\retrieveRange().

& PKPGiftDAO::getGiftsByTypeAndRecipient (   $assocType,
  $assocId,
  $giftType,
  $userId,
  $rangeInfo = null 
)

Retrieve an array of redeemed and unredeemed gifts of a certain type for a recipient user.

Parameters
$assocTypeint
$assocIdint
$giftTypeint
$userIdint
Returns
object DAOResultFactory containing matching Gifts

Definition at line 415 of file PKPGiftDAO.inc.php.

References DAO\retrieveRange().

PKPGiftDAO::getInsertGiftId ( )

Get the ID of the last inserted gift.

Returns
int

Definition at line 500 of file PKPGiftDAO.inc.php.

References DAO\getInsertId().

Referenced by insertObject().

& PKPGiftDAO::getNotRedeemedGiftsByRecipient (   $assocType,
  $assocId,
  $userId,
  $rangeInfo = null 
)

Retrieve an array of unredeemed gifts for a recipient user.

Parameters
$assocTypeint
$assocIdint
$userIdint
Returns
object DAOResultFactory containing matching Gifts

Definition at line 445 of file PKPGiftDAO.inc.php.

References DAO\retrieveRange().

& PKPGiftDAO::getNotRedeemedGiftsByTypeAndRecipient (   $assocType,
  $assocId,
  $giftType,
  $userId,
  $rangeInfo = null 
)

Retrieve an array of unredeemed gifts of a certain type for a recipient user.

Parameters
$assocTypeint
$assocIdint
$giftTypeint
$userIdint
Returns
object DAOResultFactory containing matching Gifts

Definition at line 474 of file PKPGiftDAO.inc.php.

References DAO\retrieveRange().

PKPGiftDAO::insertObject ( $gift)

Insert a new Gift.

Parameters
$giftGift object
Returns
int

Definition at line 116 of file PKPGiftDAO.inc.php.

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

PKPGiftDAO::PKPGiftDAO ( )

Constructor

Definition at line 29 of file PKPGiftDAO.inc.php.

PKPGiftDAO::recipientHasGift (   $assocType,
  $assocId,
  $userId,
  $giftId 
)

Check if recipient user has a gift.

Parameters
$assocTypeint
$assocIdint
$userIdint
$giftIdint
Returns
boolean

Definition at line 285 of file PKPGiftDAO.inc.php.

References DAO\retrieve().

Referenced by GiftDAO\redeemGift().

PKPGiftDAO::recipientHasNotRedeemedGift (   $assocType,
  $assocId,
  $userId,
  $giftId 
)

Check if recipient user has a gift that is unreedemed.

Parameters
$assocTypeint
$assocIdint
$userIdint
$giftIdint
Returns
boolean

Definition at line 316 of file PKPGiftDAO.inc.php.

References DAO\retrieve().

Referenced by GiftDAO\redeemGift().

PKPGiftDAO::redeemGift (   $assocType,
  $assocId,
  $userId,
  $giftId 
)

Redeem a gift for a recipient user.

Parameters
$assocTypeint
$assocIdint
$userIdint
$giftIdint
Returns
int Status code indicating whether gift could be redeemed

Definition at line 349 of file PKPGiftDAO.inc.php.

PKPGiftDAO::updateObject ( $gift)

Update an existing gift.

Parameters
$giftGift
Returns
boolean

Definition at line 173 of file PKPGiftDAO.inc.php.

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

Referenced by GiftDAO\redeemGift().


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