Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
PKPAnnouncementDAO Class Reference
Inheritance diagram for PKPAnnouncementDAO:
DAO AnnouncementDAO

Public Member Functions

 _fromRow ($row)
 
 deleteByAssoc ($assocType, $assocId)
 
 deleteById ($announcementId)
 
 deleteByTypeId ($typeId)
 
 deleteObject ($announcement)
 
 getAnnouncementAssocId ($announcementId)
 
 getAnnouncementAssocType ($announcementId)
 
 getAnnouncementsNotExpiredByAssocId ($assocType, $assocId, $rangeInfo=null)
 
 getByAssocId ($assocType, $assocId, $rangeInfo=null)
 
 getById ($announcementId)
 
 getByTypeId ($typeId, $rangeInfo=null)
 
 getInsertId ()
 
 getLocaleFieldNames ()
 
 getMostRecentAnnouncementByAssocId ($assocType, $assocId)
 
 getNumAnnouncementsByAssocId ($assocType, $assocId, $numAnnouncements, $rangeInfo=null)
 
 getNumAnnouncementsNotExpiredByAssocId ($assocType, $assocId, $numAnnouncements, $rangeInfo=null)
 
 insertObject ($announcement)
 
 newDataObject ()
 
 PKPAnnouncementDAO ()
 
 updateLocaleFields ($announcement)
 
 updateObject ($announcement)
 
- 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 ()
 
getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 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

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

Detailed Description

Operations for retrieving and modifying Announcement objects.

See Also
Announcement, PKPAnnouncement

Definition at line 19 of file PKPAnnouncementDAO.inc.php.

Member Function Documentation

PKPAnnouncementDAO::_fromRow (   $row)

Internal function to return an Announcement object from a row.

Parameters
$rowarray
Returns
Announcement

Definition at line 95 of file PKPAnnouncementDAO.inc.php.

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

Referenced by getById(), and getMostRecentAnnouncementByAssocId().

PKPAnnouncementDAO::deleteByAssoc (   $assocType,
  $assocId 
)

Delete announcements by Assoc ID

Parameters
$assocTypeint ASSOC_TYPE_...
$assocIdint

Definition at line 204 of file PKPAnnouncementDAO.inc.php.

References deleteById(), and getByAssocId().

PKPAnnouncementDAO::deleteById (   $announcementId)

Delete an announcement by announcement ID.

Parameters
$announcementIdint
Returns
boolean

Definition at line 182 of file PKPAnnouncementDAO.inc.php.

References DAO\update().

Referenced by deleteByAssoc(), and deleteObject().

PKPAnnouncementDAO::deleteByTypeId (   $typeId)

Delete announcements by announcement type ID.

Parameters
$typeIdint Announcement type ID
Returns
boolean

Definition at line 192 of file PKPAnnouncementDAO.inc.php.

References deleteObject(), and getByTypeId().

PKPAnnouncementDAO::deleteObject (   $announcement)

Delete an announcement.

Parameters
$announcementAnnouncement
Returns
boolean

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

References deleteById().

Referenced by deleteByTypeId().

PKPAnnouncementDAO::getAnnouncementAssocId (   $announcementId)

Retrieve announcement Assoc ID by announcement ID.

Parameters
$announcementIdint
Returns
int

Definition at line 51 of file PKPAnnouncementDAO.inc.php.

References DAO\retrieve().

PKPAnnouncementDAO::getAnnouncementAssocType (   $announcementId)

Retrieve announcement Assoc ID by announcement ID.

Parameters
$announcementIdint
Returns
int

Definition at line 65 of file PKPAnnouncementDAO.inc.php.

References DAO\retrieve().

PKPAnnouncementDAO::getAnnouncementsNotExpiredByAssocId (   $assocType,
  $assocId,
  $rangeInfo = null 
)

Retrieve an array of announcements with no/valid expiry date matching a particular Assoc ID.

Parameters
$assocTypeint ASSOC_TYPE_...
$assocIdint
$rangeInfoDBResultRange (optional)
Returns
object DAOResultFactory containing matching Announcements

Definition at line 277 of file PKPAnnouncementDAO.inc.php.

References DAO\retrieveRange().

PKPAnnouncementDAO::getByAssocId (   $assocType,
  $assocId,
  $rangeInfo = null 
)

Retrieve an array of announcements matching a particular assoc ID.

Parameters
$assocTypeint ASSOC_TYPE_...
$assocIdint
$rangeInfoDBResultRange (optional)
Returns
object DAOResultFactory containing matching Announcements

Definition at line 219 of file PKPAnnouncementDAO.inc.php.

References DAO\retrieveRange().

Referenced by deleteByAssoc().

PKPAnnouncementDAO::getById (   $announcementId)

Retrieve an announcement by announcement ID.

Parameters
$announcementIdint
Returns
Announcement

Definition at line 32 of file PKPAnnouncementDAO.inc.php.

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

PKPAnnouncementDAO::getByTypeId (   $typeId,
  $rangeInfo = null 
)

Retrieve an array of announcements matching a particular type ID.

Parameters
$typeIdint
$rangeInfoDBResultRange (optional)
Returns
object DAOResultFactory containing matching Announcements

Definition at line 238 of file PKPAnnouncementDAO.inc.php.

References DAO\retrieveRange().

Referenced by deleteByTypeId().

PKPAnnouncementDAO::getInsertId ( )

Get the ID of the last inserted announcement.

Returns
int

Definition at line 343 of file PKPAnnouncementDAO.inc.php.

References DAO\_getInsertId().

Referenced by insertObject().

PKPAnnouncementDAO::getLocaleFieldNames ( )

Get the list of localized field names for this table

Returns
array

Definition at line 78 of file PKPAnnouncementDAO.inc.php.

PKPAnnouncementDAO::getMostRecentAnnouncementByAssocId (   $assocType,
  $assocId 
)

Retrieve most recent announcement by Assoc ID.

Parameters
$assocTypeint ASSOC_TYPE_...
$assocIdint
Returns
Announcement

Definition at line 321 of file PKPAnnouncementDAO.inc.php.

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

PKPAnnouncementDAO::getNumAnnouncementsByAssocId (   $assocType,
  $assocId,
  $numAnnouncements,
  $rangeInfo = null 
)

Retrieve an array of numAnnouncements announcements matching a particular Assoc ID.

Parameters
$assocTypeint ASSOC_TYPE_...
$assocIdint
$numAnnouncementsint Maximum number of announcements
$rangeInfoDBResultRange (optional)
Returns
object DAOResultFactory containing matching Announcements

Definition at line 256 of file PKPAnnouncementDAO.inc.php.

References DAO\retrieveRange().

PKPAnnouncementDAO::getNumAnnouncementsNotExpiredByAssocId (   $assocType,
  $assocId,
  $numAnnouncements,
  $rangeInfo = null 
)

Retrieve an array of numAnnouncements announcements with no/valid expiry date matching a particular Assoc ID.

Parameters
$assocTypeint ASSOC_TYPE_...
$assocIdint
$numAnnouncementsMaximum number of announcements to include
$rangeInfoDBResultRange (optional)
Returns
object DAOResultFactory containing matching Announcements

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

References DAO\retrieveRange().

PKPAnnouncementDAO::insertObject (   $announcement)

Insert a new Announcement.

Parameters
$announcementAnnouncement
Returns
int

Definition at line 124 of file PKPAnnouncementDAO.inc.php.

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

PKPAnnouncementDAO::newDataObject ( )

Get a new data object.

Returns
DataObject

Definition at line 86 of file PKPAnnouncementDAO.inc.php.

Referenced by _fromRow().

PKPAnnouncementDAO::PKPAnnouncementDAO ( )

Constructor

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

PKPAnnouncementDAO::updateLocaleFields (   $announcement)

Update the settings for this object

Parameters
$announcementobject

Definition at line 113 of file PKPAnnouncementDAO.inc.php.

References DAO\updateDataObjectSettings().

Referenced by insertObject(), and updateObject().

PKPAnnouncementDAO::updateObject (   $announcement)

Update an existing announcement.

Parameters
$announcementAnnouncement
Returns
boolean

Definition at line 147 of file PKPAnnouncementDAO.inc.php.

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


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