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

Public Member Functions

_returnReferralFromRow (&$row)
 
 deleteReferral ($referral)
 
 deleteReferralById ($referralId)
 
 getByUserId ($userId, $journalId, $status=null, $rangeInfo=null)
 
 getInsertObjectId ()
 
 getLocaleFieldNames ()
 
getPublishedReferralsForArticle ($articleId, $rangeInfo=null)
 
getReferral ($referralId)
 
 incrementReferralCount ($articleId, $url)
 
 referralExistsByUrl ($articleId, $url)
 
 replaceReferral (&$referral)
 
 updateLocaleFields (&$referral)
 
 updateReferral (&$referral)
 
- 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 Referral objects.

See Also
Referral

Definition at line 17 of file ReferralDAO.inc.php.

Member Function Documentation

& ReferralDAO::_returnReferralFromRow ( $row)

Internal function to return a Referral object from a row.

Parameters
$rowarray
Returns
Referral

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

References DAO\datetimeFromDB().

Referenced by getReferral().

ReferralDAO::deleteReferral (   $referral)

Delete a referral. deleted.

Parameters
$referralReferral
Returns
boolean

Definition at line 169 of file ReferralDAO.inc.php.

References deleteReferralById().

ReferralDAO::deleteReferralById (   $referralId)

Delete a referral by referral ID.

Parameters
$referralIdint
Returns
boolean

Definition at line 178 of file ReferralDAO.inc.php.

References DAO\update().

Referenced by deleteReferral().

ReferralDAO::getByUserId (   $userId,
  $journalId,
  $status = null,
  $rangeInfo = null 
)

Retrieve an iterator of referrals for a particular user ID, optionally filtering by status.

Parameters
$userIdint
$journalIdint $param $status int
Returns
object DAOResultFactory containing matching Referrals

Definition at line 191 of file ReferralDAO.inc.php.

References DAO\retrieveRange().

ReferralDAO::getInsertObjectId ( )

Get the ID of the last inserted referral.

Returns
int

Definition at line 234 of file ReferralDAO.inc.php.

References DAO\getInsertId().

Referenced by replaceReferral().

ReferralDAO::getLocaleFieldNames ( )

Get a list of localized field names

Returns
array

Definition at line 40 of file ReferralDAO.inc.php.

& ReferralDAO::getPublishedReferralsForArticle (   $articleId,
  $rangeInfo = null 
)

Retrieve an iterator of published referrals for a particular user article

Parameters
$articleIdint $param $rangeInfo RangeInfo
Returns
object DAOResultFactory containing matching Referrals

Definition at line 216 of file ReferralDAO.inc.php.

References DAO\retrieveRange().

& ReferralDAO::getReferral (   $referralId)

Retrieve an referral by referral ID.

Parameters
$referralIdint
Returns
Referral

Definition at line 23 of file ReferralDAO.inc.php.

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

ReferralDAO::incrementReferralCount (   $articleId,
  $url 
)

Increment the referral count.

Parameters
$articleIdint
$urlstring
Returns
int 1 iff the referral exists

Definition at line 94 of file ReferralDAO.inc.php.

References DAO\update().

ReferralDAO::referralExistsByUrl (   $articleId,
  $url 
)

Check if a referrer exists with the given article and URL.

Parameters
$articleIdint
$urlstring
Returns
boolean

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

References DAO\retrieve().

ReferralDAO::replaceReferral ( $referral)

Insert a new Referral or replace the Referral if it already exists

Parameters
$referralReferral
Returns
int

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

References DAO\datetimeToDB(), getInsertObjectId(), DAO\replace(), and updateLocaleFields().

ReferralDAO::updateLocaleFields ( $referral)

Update the localized settings for this object

Parameters
$referralobject

Definition at line 105 of file ReferralDAO.inc.php.

References DAO\updateDataObjectSettings().

Referenced by replaceReferral(), and updateReferral().

ReferralDAO::updateReferral ( $referral)

Update an existing referral.

Parameters
$referralReferral
Returns
boolean

Definition at line 140 of file ReferralDAO.inc.php.

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


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