Open Journal Systems  3.3.0
NoteDAO Class Reference
Inheritance diagram for NoteDAO:
DAO

Public Member Functions

 _fromRow ($row)
 
 deleteByAssoc ($assocType, $assocId)
 
 deleteById ($noteId, $userId=null)
 
 deleteObject ($note)
 
 getByAssoc ($assocType, $assocId, $userId=null, $orderBy=NOTE_ORDER_DATE_CREATED, $sortDirection=SORT_DIRECTION_DESC, $isAdmin=false)
 
 getById ($noteId)
 
 getByUserId ($userId, $rangeInfo=null)
 
 getInsertId ()
 
 insertObject ($note)
 
 newDataObject ()
 
 notesExistByAssoc ($assocType, $assocId, $userId=null)
 
 unreadNotesExistByAssoc ($assocType, $assocId, $userId)
 
 updateObject ($note)
 
- 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)
 

Additional Inherited Members

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

Detailed Description

Operations for retrieving and modifying Note objects.

See also
Note

Definition at line 22 of file NoteDAO.inc.php.

Member Function Documentation

◆ _fromRow()

NoteDAO::_fromRow (   $row)

Creates and returns an note object from a row

Parameters
$rowarray
Returns
Note object

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

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

Referenced by getById().

◆ deleteByAssoc()

NoteDAO::deleteByAssoc (   $assocType,
  $assocId 
)

Delete notes by association

Parameters
$assocTypeint ASSOC_TYPE_...
$assocIdint Foreign key, depending on $assocType

Definition at line 271 of file NoteDAO.inc.php.

References deleteObject(), and getByAssoc().

◆ deleteById()

NoteDAO::deleteById (   $noteId,
  $userId = null 
)

Delete Note by note id

Parameters
$noteIdint
$userIdint optional

Definition at line 255 of file NoteDAO.inc.php.

References DAO\update().

Referenced by deleteObject().

◆ deleteObject()

NoteDAO::deleteObject (   $note)

Delete a note by note object.

Parameters
$noteNote

Definition at line 246 of file NoteDAO.inc.php.

References deleteById().

Referenced by deleteByAssoc().

◆ getByAssoc()

NoteDAO::getByAssoc (   $assocType,
  $assocId,
  $userId = null,
  $orderBy = NOTE_ORDER_DATE_CREATED,
  $sortDirection = SORT_DIRECTION_DESC,
  $isAdmin = false 
)

Retrieve Notes by assoc id/type

Parameters
$assocIdint ASSOC_TYPE_...
$assocTypeint Assoc ID (per $assocType)
$userIdint Optional user ID
$orderByint Optional sorting field constant: NOTE_ORDER_...
$sortDirectionint Optional sorting order constant: SORT_DIRECTION_...
Returns
object DAOResultFactory containing matching Note objects

Definition at line 73 of file NoteDAO.inc.php.

References DAO\retrieve().

Referenced by deleteByAssoc().

◆ getById()

NoteDAO::getById (   $noteId)

Retrieve Note by note id

Parameters
$noteIdint Note ID
Returns
Note object

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

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

◆ getByUserId()

NoteDAO::getByUserId (   $userId,
  $rangeInfo = null 
)

Retrieve Notes by user id

Parameters
$userIdint User ID
$rangeInfoDBResultRange Optional
Returns
object DAOResultFactory containing matching Note objects

Definition at line 54 of file NoteDAO.inc.php.

References DAO\retrieveRange().

◆ getInsertId()

NoteDAO::getInsertId ( )

Get the ID of the last inserted note

Returns
int

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

References DAO\_getInsertId().

Referenced by insertObject().

◆ insertObject()

NoteDAO::insertObject (   $note)

Inserts a new note into notes table

Parameters
Noteobject
Returns
int Note Id

Definition at line 189 of file NoteDAO.inc.php.

References DAO\datetimeToDB(), Core\getCurrentDate(), getInsertId(), and DAO\update().

◆ newDataObject()

NoteDAO::newDataObject ( )

Create a new data object

Returns
Note

Definition at line 28 of file NoteDAO.inc.php.

Referenced by _fromRow().

◆ notesExistByAssoc()

NoteDAO::notesExistByAssoc (   $assocType,
  $assocId,
  $userId = null 
)

Retrieve Notes by assoc id/type

Parameters
$assocIdint
$assocTypeint
$userIdint
Returns
object DAOResultFactory containing matching Note objects

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

References DAO\retrieve().

◆ unreadNotesExistByAssoc()

NoteDAO::unreadNotesExistByAssoc (   $assocType,
  $assocId,
  $userId 
)

Determine whether or not unread notes exist for a given association

Parameters
$assocTypeint ASSOC_TYPE_...
$assocIdint Foreign key, depending on ASSOC_TYPE
$userIdint User ID

Definition at line 139 of file NoteDAO.inc.php.

References DAO\retrieve().

◆ updateObject()

NoteDAO::updateObject (   $note)

Update a note in the notes table

Parameters
Noteobject
Returns
int Note Id

Definition at line 217 of file NoteDAO.inc.php.

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


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