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

Public Member Functions

_returnSubscriptionFromRow (&$row)
 
 createObject ()
 
 deleteSubscriptionById ($subscriptionId)
 
 deleteSubscriptionsByJournal ($journalId)
 
 deleteSubscriptionsByTypeId ($subscriptionTypeId)
 
 deleteSubscriptionsByUserId ($userId)
 
 deleteSubscriptionsByUserIdForJournal ($userId, $journalId)
 
 getStatusCount ($journalId, $status=null)
 
 getSubscribedUserCount ($journalId)
 
getSubscribedUsers ($journalId, $rangeInfo=null)
 
getSubscription ($subscriptionId)
 
getSubscriptionByUserForJournal ($userId, $journalId)
 
 getSubscriptionIdByUser ($userId, $journalId)
 
getSubscriptions ($rangeInfo=null)
 
getSubscriptionsByJournalId ($journalId, $status=null, $searchField=null, $searchMatch=null, $search=null, $dateField=null, $dateFrom=null, $dateTo=null, $rangeInfo=null)
 
getSubscriptionsByUser ($userId, $rangeInfo=null)
 
getSubscriptionsToRemind ($dateEnd, $journalId, $reminderType, $rangeInfo=null)
 
 insertSubscription (&$individualSubscription)
 
 isValidIndividualSubscription ($userId, $journalId, $check=SUBSCRIPTION_DATE_BOTH, $checkDate=null)
 
 renewSubscription (&$individualSubscription)
 
 subscriptionExists ($subscriptionId)
 
 subscriptionExistsByUser ($subscriptionId, $userId)
 
 subscriptionExistsByUserForJournal ($userId, $journalId)
 
 updateSubscription (&$individualSubscription)
 
- Public Member Functions inherited from SubscriptionDAO
 _generateSearchSQL ($status=null, $searchField=null, $searchMatch=null, $search=null, $dateField=null, $dateFrom=null, $dateTo=null, &$params)
 
 _generateUserNameSearchSQL ($search, $searchMatch, $prefix, &$params)
 
 _insertSubscription (&$subscription)
 
 _renewSubscription (&$subscription)
 
_returnSubscriptionFromRow (&$row)
 
 _updateSubscription (&$subscription)
 
 createObject ()
 
 deleteSubscriptionById ($subscriptionId)
 
 deleteSubscriptionsByJournal ($journalId)
 
 deleteSubscriptionsByTypeId ($subscriptionTypeId)
 
 deleteSubscriptionsByUserId ($userId)
 
 flagReminded ($subscriptionId, $reminderType)
 
 getInsertSubscriptionId ()
 
 getStatusCount ($status)
 
getStatusOptions ()
 
getSubscription ($subscriptionId)
 
 getSubscriptionJournalId ($subscriptionId)
 
getSubscriptions ($rangeInfo=null)
 
getSubscriptionsByJournalId ($journalId, $status=null, $searchField=null, $searchMatch=null, $search=null, $dateField=null, $dateFrom=null, $dateTo=null, $rangeInfo=null)
 
getSubscriptionsToRemind ($dateEnd, $journalId, $reminderType, $rangeInfo=null)
 
 insertSubscription (&$subscription)
 
 renewSubscription (&$subscription)
 
 subscriptionExists ($subscriptionId)
 
 subscriptionExistsByUser ($subscriptionId, $userId)
 
 subscriptionExistsByUserForJournal ($userId, $journalId)
 
 updateSubscription (&$subscription)
 
- 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 IndividualSubscription objects.

See Also
IndividualSubscription

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

Member Function Documentation

& IndividualSubscriptionDAO::_returnSubscriptionFromRow ( $row)

Internal function to return an IndividualSubscription object from a row.

Parameters
$rowarray
Returns
IndividualSubscription

Definition at line 270 of file IndividualSubscriptionDAO.inc.php.

References HookRegistry\call().

Referenced by getSubscription(), and getSubscriptionByUserForJournal().

IndividualSubscriptionDAO::createObject ( )

Generator function to create object.

Returns
IndividualSubscription

Definition at line 261 of file IndividualSubscriptionDAO.inc.php.

IndividualSubscriptionDAO::deleteSubscriptionById (   $subscriptionId)

Delete an individual subscription by subscription ID.

Parameters
$subscriptionIdint
Returns
boolean

Definition at line 300 of file IndividualSubscriptionDAO.inc.php.

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

Referenced by deleteSubscriptionsByJournal(), deleteSubscriptionsByTypeId(), deleteSubscriptionsByUserId(), and deleteSubscriptionsByUserIdForJournal().

IndividualSubscriptionDAO::deleteSubscriptionsByJournal (   $journalId)

Delete individual subscriptions by journal ID.

Parameters
$journalIdint
Returns
boolean

Definition at line 319 of file IndividualSubscriptionDAO.inc.php.

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

IndividualSubscriptionDAO::deleteSubscriptionsByTypeId (   $subscriptionTypeId)

Delete all individual subscriptions by subscription type ID.

Parameters
$subscriptionTypeIdint
Returns
boolean

Definition at line 420 of file IndividualSubscriptionDAO.inc.php.

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

IndividualSubscriptionDAO::deleteSubscriptionsByUserId (   $userId)

Delete individual subscriptions by user ID.

Parameters
$userIdint
Returns
boolean

Definition at line 351 of file IndividualSubscriptionDAO.inc.php.

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

IndividualSubscriptionDAO::deleteSubscriptionsByUserIdForJournal (   $userId,
  $journalId 
)

Delete individual subscription by user ID and journal ID.

Parameters
$userIdint
$journalIdint
Returns
boolean

Definition at line 384 of file IndividualSubscriptionDAO.inc.php.

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

IndividualSubscriptionDAO::getStatusCount (   $journalId,
  $status = null 
)

Return number of individual subscriptions with given status for journal.

Parameters
statusint
Returns
int

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

References DAO\retrieve().

Referenced by getSubscribedUserCount().

IndividualSubscriptionDAO::getSubscribedUserCount (   $journalId)

Get the number of individual subscriptions for a particular journal.

Parameters
$journalIdint
Returns
int

Definition at line 168 of file IndividualSubscriptionDAO.inc.php.

References getStatusCount().

& IndividualSubscriptionDAO::getSubscribedUsers (   $journalId,
  $rangeInfo = null 
)

Retrieve all individual subscribed users.

Returns
object DAOResultFactory containing IndividualSubscriptions

Definition at line 477 of file IndividualSubscriptionDAO.inc.php.

References DAORegistry\getDAO(), and DAO\retrieveRange().

& IndividualSubscriptionDAO::getSubscription (   $subscriptionId)

Retrieve an individual subscription by subscription ID.

Parameters
$subscriptionIdint
Returns
IndividualSubscription

Definition at line 26 of file IndividualSubscriptionDAO.inc.php.

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

& IndividualSubscriptionDAO::getSubscriptionByUserForJournal (   $userId,
  $journalId 
)

Retrieve individual subscription by user ID for journal.

Parameters
$userIdint
$journalIdint
Returns
IndividualSubscriptions

Definition at line 55 of file IndividualSubscriptionDAO.inc.php.

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

IndividualSubscriptionDAO::getSubscriptionIdByUser (   $userId,
  $journalId 
)

Retrieve individual subscription ID by user ID.

Parameters
$userIdint
$journalIdint
Returns
int

Definition at line 111 of file IndividualSubscriptionDAO.inc.php.

References DAO\retrieve().

& IndividualSubscriptionDAO::getSubscriptions (   $rangeInfo = null)

Retrieve all individual subscriptions.

Returns
object DAOResultFactory containing IndividualSubscriptions

Definition at line 451 of file IndividualSubscriptionDAO.inc.php.

References DAO\retrieveRange().

& IndividualSubscriptionDAO::getSubscriptionsByJournalId (   $journalId,
  $status = null,
  $searchField = null,
  $searchMatch = null,
  $search = null,
  $dateField = null,
  $dateFrom = null,
  $dateTo = null,
  $rangeInfo = null 
)

Retrieve individual subscriptions matching a particular journal ID.

Parameters
$journalIdint
$statusint
$searchFieldint
$searchMatchstring "is" or "contains" or "startsWith"
$searchString to look in $searchField for
$dateFieldint
$dateFromString date to search from
$dateToString date to search to
Returns
object DAOResultFactory containing matching IndividualSubscriptions

Definition at line 510 of file IndividualSubscriptionDAO.inc.php.

References DAO\retrieveRange().

& IndividualSubscriptionDAO::getSubscriptionsByUser (   $userId,
  $rangeInfo = null 
)

Retrieve individual subscriptions by user ID.

Parameters
$userIdint
Returns
object DAOResultFactory containing IndividualSubscriptions

Definition at line 87 of file IndividualSubscriptionDAO.inc.php.

References DAO\retrieveRange().

& IndividualSubscriptionDAO::getSubscriptionsToRemind (   $dateEnd,
  $journalId,
  $reminderType,
  $rangeInfo = null 
)

Retrieve active individual subscriptions matching a particular end date and journal ID.

Parameters
$dateEnddate
$journalIdint
$reminderTypeint SUBSCRIPTION_REMINDER_FIELD_..._EXPIRY
Returns
object DAOResultFactory containing matching IndividualSubscriptions

Definition at line 607 of file IndividualSubscriptionDAO.inc.php.

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

IndividualSubscriptionDAO::insertSubscription ( $individualSubscription)

Insert a new individual subscription.

Parameters
$individualSubscriptionIndividualSubscription
Returns
int

Definition at line 282 of file IndividualSubscriptionDAO.inc.php.

References SubscriptionDAO\_insertSubscription().

IndividualSubscriptionDAO::isValidIndividualSubscription (   $userId,
  $journalId,
  $check = SUBSCRIPTION_DATE_BOTH,
  $checkDate = null 
)

Check whether user with ID has a valid individual subscription for a given journal.

Parameters
$userIdint
$journalIdint
$checkint Check using either start date, end date, or both (default)
$checkDatedate (YYYY-MM-DD) Use this date instead of current date
Returns
int

Definition at line 544 of file IndividualSubscriptionDAO.inc.php.

References DAO\dateToDB(), Core\getCurrentDate(), and DAO\retrieve().

IndividualSubscriptionDAO::renewSubscription ( $individualSubscription)

Renew an individual subscription by dateEnd + duration of subscription type if the individual subscription is expired, renew to current date + duration

Parameters
$individualSubscriptionIndividualSubscription
Returns
boolean

Definition at line 641 of file IndividualSubscriptionDAO.inc.php.

References SubscriptionDAO\_renewSubscription().

IndividualSubscriptionDAO::subscriptionExists (   $subscriptionId)

Check if an individual subscription exists for a given subscriptionId.

Parameters
$subscriptionIdint
Returns
boolean

Definition at line 177 of file IndividualSubscriptionDAO.inc.php.

References DAO\retrieve().

Referenced by deleteSubscriptionById().

IndividualSubscriptionDAO::subscriptionExistsByUser (   $subscriptionId,
  $userId 
)

Check if an individual subscription exists for a given user.

Parameters
$subscriptionIdint
$userIdint
Returns
boolean

Definition at line 203 of file IndividualSubscriptionDAO.inc.php.

References DAO\retrieve().

IndividualSubscriptionDAO::subscriptionExistsByUserForJournal (   $userId,
  $journalId 
)

Check if an individual subscription exists for a given user and journal.

Parameters
$userIdint
$journalIdint
Returns
boolean

Definition at line 233 of file IndividualSubscriptionDAO.inc.php.

References DAO\retrieve().

IndividualSubscriptionDAO::updateSubscription ( $individualSubscription)

Update an existing individual subscription.

Parameters
$individualSubscriptionIndividualSubscription
Returns
boolean

Definition at line 291 of file IndividualSubscriptionDAO.inc.php.

References SubscriptionDAO\_updateSubscription().


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