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

Public Member Functions

_filterCitation (&$request, &$citation, &$filterCallback, $citationStateAfterFiltering, $fromFilterIds=array())
 
_fromRow (&$row)
 
 _getCitationSourceDescriptions ($citationId)
 
_instantiateLookupFilters (&$citation, &$metadataDescription, $contextId, $fromFilterIds)
 
_instantiateParserFilters (&$citation, &$metadataDescription, $contextId, $fromFilterIds)
 
_newDataObject ()
 
 _updateObjectMetadata (&$citation)
 
checkCitation (&$request, &$originalCitation, $filterIds=array())
 
 checkNextRawCitation (&$request, $lockId)
 
 CitationDAO ()
 
 deleteObject (&$citation)
 
 deleteObjectById ($citationId)
 
 deleteObjectsByAssocId ($assocType, $assocId)
 
getCitationFilterInstances ($contextId, $filterGroups, $fromFilterIds=array(), $includeOptionalFilters=false)
 
 getInsertId ()
 
getObjectById ($citationId)
 
getObjectsByAssocId ($assocType, $assocId, $minCitationState=0, $maxCitationState=CITATION_APPROVED, $rangeInfo=null)
 
 importCitations (&$request, $assocType, $assocId, $rawCitationList)
 
 insertObject (&$citation)
 
instantiateCitationOutputFilter (&$context)
 
 updateCitationSourceDescriptions (&$citation)
 
 updateObject (&$citation)
 
- 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 Citation objects.

See Also
Citation

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

Member Function Documentation

& CitationDAO::_filterCitation ( $request,
$citation,
$filterCallback,
  $citationStateAfterFiltering,
  $fromFilterIds = array() 
)

Call the callback to filter the citation. If errors occur they'll be added to the citation form.

Parameters
$requestRequest
$citationCitation
$filterCallbackcallable
$citationStateAfterFilteringinteger the state the citation will be set to after the filter was executed.
$fromFilterIdsonly use filters with the given ids
Returns
Citation the filtered citation or null if an error occurred

Definition at line 590 of file CitationDAO.inc.php.

References instantiateCitationOutputFilter(), and PersistableFilter\tempGroup().

Referenced by checkCitation().

& CitationDAO::_fromRow ( $row)

Internal function to return a citation object from a row.

Parameters
$rowarray
Returns
Citation

Definition at line 486 of file CitationDAO.inc.php.

References _getCitationSourceDescriptions(), and _newDataObject().

Referenced by checkNextRawCitation(), and getObjectById().

CitationDAO::_getCitationSourceDescriptions (   $citationId)

Get the source descriptions of an existing citation.

Parameters
$citationIdinteger
Returns
array an array of MetadataDescriptions

Definition at line 522 of file CitationDAO.inc.php.

References DAORegistry\getDAO().

Referenced by _fromRow().

& CitationDAO::_instantiateLookupFilters ( $citation,
$metadataDescription,
  $contextId,
  $fromFilterIds 
)

Instantiates filters that can validate and amend citations with information from external data sources.

Parameters
$citationCitation
$metadataDescriptionMetadataDescription
$contextIdinteger
$fromFilterIdsarray restrict results to those with the given ids
Returns
array everything needed to define the transformation:
  • the display name of the transformation
  • the input/output type definition
  • input data
  • a filter list

Definition at line 566 of file CitationDAO.inc.php.

References getCitationFilterInstances().

& CitationDAO::_instantiateParserFilters ( $citation,
$metadataDescription,
  $contextId,
  $fromFilterIds 
)

Instantiates filters that can parse a citation.

Parameters
$citationCitation
$metadataDescriptionMetadataDescription
$contextIdinteger
$fromFilterIdsarray restrict results to those with the given ids
Returns
array everything needed to define the transformation:
  • the display name of the transformation
  • the input/output type definition
  • input data
  • a filter list

Definition at line 540 of file CitationDAO.inc.php.

References getCitationFilterInstances().

& CitationDAO::_newDataObject ( )

Construct a new citation object.

Returns
Citation

Definition at line 475 of file CitationDAO.inc.php.

Referenced by _fromRow().

CitationDAO::_updateObjectMetadata ( $citation)

Update the citation meta-data

Parameters
$citationCitation

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

References DAO\updateDataObjectSettings().

Referenced by insertObject(), and updateObject().

& CitationDAO::checkCitation ( $request,
$originalCitation,
  $filterIds = array() 
)

Parses and looks up the given citation.

NB: checking the citation will not automatically persist the changes. This has to be done by the caller.

Parameters
$requestRequest
$originalCitationCitation
$filterIdsarray a custom selection of filters to be applied
Returns
Citation the checked citation. If checking was not successful then the original citation will be returned unchanged.

Definition at line 161 of file CitationDAO.inc.php.

References _filterCitation().

Referenced by checkNextRawCitation().

CitationDAO::checkNextRawCitation ( $request,
  $lockId 
)

Claims (locks) the next raw (unparsed) citation found in the database and checks it. This method is idempotent and parallelisable. It uses an atomic locking strategy to avoid race conditions.

Parameters
$requestRequest
$lockIdstring a globally unique id that identifies the calling process.
Returns
boolean true if a citation was found and checked, otherwise false.

Definition at line 194 of file CitationDAO.inc.php.

References _fromRow(), checkCitation(), DAO\retrieve(), DAO\update(), and updateObject().

CitationDAO::CitationDAO ( )

Constructor

Definition at line 30 of file CitationDAO.inc.php.

CitationDAO::deleteObject ( $citation)

Delete a citation.

Parameters
$citationCitation
Returns
boolean

Definition at line 370 of file CitationDAO.inc.php.

References deleteObjectById().

CitationDAO::deleteObjectById (   $citationId)

Delete a citation by id.

Parameters
$citationIdint
Returns
boolean

Definition at line 379 of file CitationDAO.inc.php.

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

Referenced by deleteObject(), and deleteObjectsByAssocId().

CitationDAO::deleteObjectsByAssocId (   $assocType,
  $assocId 
)

Delete all citations matching a particular association id.

Parameters
$assocTypeint
$assocIdint
Returns
boolean

Definition at line 398 of file CitationDAO.inc.php.

References deleteObjectById(), and getObjectsByAssocId().

Referenced by importCitations().

& CitationDAO::getCitationFilterInstances (   $contextId,
  $filterGroups,
  $fromFilterIds = array(),
  $includeOptionalFilters = false 
)

Instantiate citation filters according to the given selection rules.

NB: Optional citation filters will only be included when a specific set of filter ids is being given or when the $includeOptionalFilters flag is set to true.

Parameters
$contextIdinteger the context for which the filters should be retrieved (journal, conference, press, etc.)
$filterGroupsstring|array the symbolic name(s) of the filter group(s) to be loaded.
$fromFilterIdsarray restrict results to those with the given ids
$includeOptionalFiltersboolean
Returns
array an array of PersistableFilters

Definition at line 298 of file CitationDAO.inc.php.

References DAORegistry\getDAO().

Referenced by _instantiateLookupFilters(), and _instantiateParserFilters().

CitationDAO::getInsertId ( )

Get the id of the last inserted citation.

Returns
int

Definition at line 463 of file CitationDAO.inc.php.

Referenced by insertObject().

& CitationDAO::getObjectById (   $citationId)

Retrieve a citation by id.

Parameters
$citationIdinteger
Returns
Citation

Definition at line 85 of file CitationDAO.inc.php.

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

& CitationDAO::getObjectsByAssocId (   $assocType,
  $assocId,
  $minCitationState = 0,
  $maxCitationState = CITATION_APPROVED,
  $rangeInfo = null 
)

Retrieve an array of citations matching a particular association id.

Parameters
$assocTypeint
$assocIdint
$minCitationStateint one of the CITATION_* constants, leaving this unset will show all citation states.
$maxCitationStateint one of the CITATION_* constants, leaving this unset will show all citation states.
$dbResultRangeDBResultRange the desired range
Returns
DAOResultFactory containing matching Citations

Definition at line 268 of file CitationDAO.inc.php.

References DAO\retrieveRange().

Referenced by deleteObjectsByAssocId().

CitationDAO::importCitations ( $request,
  $assocType,
  $assocId,
  $rawCitationList 
)

Import citations from a raw citation list to the object described by the given association type and id.

Parameters
$requestRequest
$assocTypeint
$assocIdint
$rawCitationListstring
Returns
integer the number of spawned citation checking processes

Definition at line 108 of file CitationDAO.inc.php.

References deleteObjectsByAssocId(), DAORegistry\getDAO(), Config\getVar(), and insertObject().

CitationDAO::insertObject ( $citation)

Insert a new citation.

Parameters
$citationCitation
Returns
integer the new citation id

Definition at line 39 of file CitationDAO.inc.php.

References _updateObjectMetadata(), getInsertId(), DAO\retrieve(), DAO\update(), and updateCitationSourceDescriptions().

Referenced by importCitations().

& CitationDAO::instantiateCitationOutputFilter ( $context)

Instantiates the citation output format filter currently configured for the context.

Parameters
$contextobject journal, press or conference
Returns
PersistableFilter

Definition at line 436 of file CitationDAO.inc.php.

References DAORegistry\getDAO().

Referenced by _filterCitation().

CitationDAO::updateCitationSourceDescriptions ( $citation)

Update the source descriptions of an existing citation.

Parameters
$citationCitation

Definition at line 412 of file CitationDAO.inc.php.

References DAORegistry\getDAO().

Referenced by insertObject(), and updateObject().

CitationDAO::updateObject ( $citation)

Update an existing citation.

Parameters
$citationCitation

Definition at line 340 of file CitationDAO.inc.php.

References _updateObjectMetadata(), DAO\update(), and updateCitationSourceDescriptions().

Referenced by checkNextRawCitation().


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