Open Journal Systems  3.3.0
AnnouncementDAO Class Reference
Inheritance diagram for AnnouncementDAO:
SchemaDAO DAO

Public Member Functions

 deleteByAssoc ($assocType, $assocId)
 
 deleteByTypeId ($typeId)
 
 getAnnouncementAssocId ($announcementId)
 
 getAnnouncementAssocType ($announcementId)
 
 getAnnouncementsNotExpiredByAssocId ($assocType, $assocId, $rangeInfo=null)
 
 getByAssocId ($assocType, $assocId, $rangeInfo=null)
 
 getById ($announcementId, $assocType=null, $assocId=null)
 
 getByTypeId ($typeId, $rangeInfo=null)
 
 getInsertId ()
 
 getMostRecentAnnouncementByAssocId ($assocType, $assocId)
 
 getNumAnnouncementsByAssocId ($assocType, $assocId, $numAnnouncements, $rangeInfo=null)
 
 getNumAnnouncementsNotExpiredByAssocId ($assocType, $assocId, $numAnnouncements, $rangeInfo=null)
 
 newDataObject ()
 
- Public Member Functions inherited from SchemaDAO
 _fromRow ($primaryRow)
 
 deleteById ($objectId)
 
 deleteObject ($object)
 
 getById ($objectId)
 
 insertObject ($object)
 
 updateObject ($object)
 
- 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)
 

Data Fields

 $primaryKeyColumn = 'announcement_id'
 
 $primaryTableColumns
 
 $schemaName = SCHEMA_ANNOUNCEMENT
 
 $settingsTableName = 'announcement_settings'
 
 $tableName = 'announcements'
 
- Data Fields inherited from SchemaDAO
 $primaryKeyColumn
 
 $primaryTableColumns = array()
 
 $schemaName
 
 $settingsTableName
 
 $tableName
 
- Data Fields inherited from DAO
 $_dataSource
 

Additional Inherited Members

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

Detailed Description

Operations for retrieving and modifying Announcement objects.

See also
Announcement

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

Member Function Documentation

◆ deleteByAssoc()

AnnouncementDAO::deleteByAssoc (   $assocType,
  $assocId 
)

Delete announcements by Assoc ID

Parameters
$assocTypeint ASSOC_TYPE_...
$assocIdint

Definition at line 137 of file AnnouncementDAO.inc.php.

References SchemaDAO\deleteById(), and getByAssocId().

◆ deleteByTypeId()

AnnouncementDAO::deleteByTypeId (   $typeId)

Delete announcements by announcement type ID.

Parameters
$typeIdint Announcement type ID
Returns
boolean

Definition at line 125 of file AnnouncementDAO.inc.php.

References SchemaDAO\deleteObject(), and getByTypeId().

◆ getAnnouncementAssocId()

AnnouncementDAO::getAnnouncementAssocId (   $announcementId)

Retrieve announcement Assoc ID by announcement ID.

Parameters
$announcementIdint
Returns
int

Definition at line 89 of file AnnouncementDAO.inc.php.

References DAO\retrieve().

◆ getAnnouncementAssocType()

AnnouncementDAO::getAnnouncementAssocType (   $announcementId)

Retrieve announcement Assoc ID by announcement ID.

Parameters
$announcementIdint
Returns
int

Definition at line 103 of file AnnouncementDAO.inc.php.

References DAO\retrieve().

◆ getAnnouncementsNotExpiredByAssocId()

AnnouncementDAO::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 210 of file AnnouncementDAO.inc.php.

References DAO\retrieveRange().

◆ getByAssocId()

AnnouncementDAO::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 152 of file AnnouncementDAO.inc.php.

References DAO\retrieveRange().

Referenced by deleteByAssoc().

◆ getById()

AnnouncementDAO::getById (   $announcementId,
  $assocType = null,
  $assocId = null 
)

Retrieve an announcement by announcement ID.

Parameters
$announcementIdint
$assocTypeint Optional assoc type
$assocIdint Optional assoc ID
Returns
Announcement

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

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

◆ getByTypeId()

AnnouncementDAO::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 171 of file AnnouncementDAO.inc.php.

References DAO\retrieveRange().

Referenced by deleteByTypeId().

◆ getInsertId()

AnnouncementDAO::getInsertId ( )

Get the ID of the last inserted announcement.

Returns
int

Reimplemented from SchemaDAO.

Definition at line 278 of file AnnouncementDAO.inc.php.

References DAO\_getInsertId().

◆ getMostRecentAnnouncementByAssocId()

AnnouncementDAO::getMostRecentAnnouncementByAssocId (   $assocType,
  $assocId 
)

Retrieve most recent announcement by Assoc ID.

Parameters
$assocTypeint ASSOC_TYPE_...
$assocIdint
Returns
Announcement

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

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

◆ getNumAnnouncementsByAssocId()

AnnouncementDAO::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 189 of file AnnouncementDAO.inc.php.

References DAO\retrieveRange().

◆ getNumAnnouncementsNotExpiredByAssocId()

AnnouncementDAO::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 234 of file AnnouncementDAO.inc.php.

References DAO\retrieveRange().

◆ newDataObject()

AnnouncementDAO::newDataObject ( )

Get a new data object.

Returns
DataObject

Reimplemented from SchemaDAO.

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

Field Documentation

◆ $primaryKeyColumn

string AnnouncementDAO::$primaryKeyColumn = 'announcement_id'

The column name for the object id in primary and settings tables

Definition at line 43 of file AnnouncementDAO.inc.php.

◆ $primaryTableColumns

array AnnouncementDAO::$primaryTableColumns
Initial value:
= [
'id' => 'announcement_id',
'assocId' => 'assoc_id',
'assocType' => 'assoc_type',
'typeId' => 'type_id',
'dateExpire' => 'date_expire',
'datePosted' => 'date_posted',
]

Maps schema properties for the primary table to their column names

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

◆ $schemaName

string AnnouncementDAO::$schemaName = SCHEMA_ANNOUNCEMENT

One of the SCHEMA_... constants

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

◆ $settingsTableName

string AnnouncementDAO::$settingsTableName = 'announcement_settings'

The name of the settings table for this object

Definition at line 37 of file AnnouncementDAO.inc.php.

◆ $tableName

string AnnouncementDAO::$tableName = 'announcements'

The name of the primary table for this object

Definition at line 31 of file AnnouncementDAO.inc.php.


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