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

Public Member Functions

 _articleFromRow (&$article, &$row)
 
_returnArticleFromRow (&$row)
 
 ArticleDAO ()
 
 changeArticleStatus ($articleId, $status)
 
 changePubId ($articleId, $pubIdType, $pubId)
 
 deleteAllPubIds ($journalId, $pubIdType)
 
 deleteArticle (&$article)
 
 deleteArticleById ($articleId)
 
 deleteArticlesByJournalId ($journalId)
 
 getAdditionalFieldNames ()
 
getArticle ($articleId, $journalId=null, $useCache=false)
 
 getArticleJournalId ($articleId)
 
getArticlesByJournalId ($journalId=null)
 
getArticlesByUserId ($userId, $journalId=null)
 
getBySetting ($settingName, $settingValue, $journalId=null, $rangeInfo=null)
 
 getInsertArticleId ()
 
 getLocaleFieldNames ()
 
 incompleteSubmissionExists ($articleId, $userId, $journalId)
 
 insertArticle (&$article)
 
 pubIdExists ($pubIdType, $pubId, $articleId, $journalId)
 
 removeArticlesFromSection ($sectionId)
 
 updateArticle (&$article)
 
 updateLocaleFields (&$article)
 
 updateSetting ($articleId, $name, $value, $type, $isLocalized=false)
 
- 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 Article objects.

See Also
Article

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

Member Function Documentation

ArticleDAO::_articleFromRow ( $article,
$row 
)

Internal function to fill in the passed article object from the row.

Parameters
$articleArticle output article
$rowarray input row

Definition at line 205 of file ArticleDAO.inc.php.

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

Referenced by _returnArticleFromRow().

& ArticleDAO::_returnArticleFromRow ( $row)

Internal function to return an Article object from a row.

Parameters
$rowarray
Returns
Article

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

References _articleFromRow().

Referenced by getArticle(), and getArticlesByUserId().

ArticleDAO::ArticleDAO ( )

Constructor.

Definition at line 42 of file ArticleDAO.inc.php.

References DAORegistry\getDAO().

ArticleDAO::changeArticleStatus (   $articleId,
  $status 
)

Change the status of the article

Parameters
$articleIdint
$statusint

Definition at line 594 of file ArticleDAO.inc.php.

References DAO\update().

ArticleDAO::changePubId (   $articleId,
  $pubIdType,
  $pubId 
)

Change the public ID of an article.

Parameters
$articleIdint
$pubIdTypestring One of the NLM pub-id-type values or 'other::something' if not part of the official NLM list (see http://dtd.nlm.nih.gov/publishing/tag-library/n-4zh0.html).
$pubIdstring

Definition at line 666 of file ArticleDAO.inc.php.

References updateSetting().

ArticleDAO::deleteAllPubIds (   $journalId,
  $pubIdType 
)

Delete the public IDs of all articles in a journal.

Parameters
$journalIdint
$pubIdTypestring One of the NLM pub-id-type values or 'other::something' if not part of the official NLM list (see http://dtd.nlm.nih.gov/publishing/tag-library/n-4zh0.html).

Definition at line 718 of file ArticleDAO.inc.php.

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

ArticleDAO::deleteArticle ( $article)

Delete an article.

Parameters
$articleArticle

Definition at line 358 of file ArticleDAO.inc.php.

References deleteArticleById().

ArticleDAO::deleteArticleById (   $articleId)

Delete an article by ID.

Parameters
$articleIdint

Definition at line 366 of file ArticleDAO.inc.php.

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

Referenced by deleteArticle(), and deleteArticlesByJournalId().

ArticleDAO::deleteArticlesByJournalId (   $journalId)

Delete all articles by journal ID.

Parameters
$journalIdint

Definition at line 494 of file ArticleDAO.inc.php.

References deleteArticleById(), and getArticlesByJournalId().

ArticleDAO::getAdditionalFieldNames ( )

Get a list of additional fields that do not have dedicated accessors.

Returns
array

Definition at line 63 of file ArticleDAO.inc.php.

& ArticleDAO::getArticle (   $articleId,
  $journalId = null,
  $useCache = false 
)

Retrieve an article by ID.

Parameters
$articleIdint
$journalIdint optional
$useCacheboolean optional
Returns
Article

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

References _returnArticleFromRow(), AppLocale\getLocale(), AppLocale\getPrimaryLocale(), and DAO\retrieve().

ArticleDAO::getArticleJournalId (   $articleId)

Get the ID of the journal an article is in.

Parameters
$articleIdint
Returns
int

Definition at line 557 of file ArticleDAO.inc.php.

References DAO\retrieve().

& ArticleDAO::getArticlesByJournalId (   $journalId = null)

Get all articles for a journal (or all articles in the system).

Parameters
$journalIdint
Returns
DAOResultFactory containing matching Articles

Definition at line 456 of file ArticleDAO.inc.php.

References AppLocale\getLocale(), AppLocale\getPrimaryLocale(), and DAO\retrieve().

Referenced by deleteAllPubIds(), and deleteArticlesByJournalId().

& ArticleDAO::getArticlesByUserId (   $userId,
  $journalId = null 
)

Get all articles for a user.

Parameters
$userIdint
$journalIdint optional
Returns
array Articles

Definition at line 509 of file ArticleDAO.inc.php.

References _returnArticleFromRow(), AppLocale\getLocale(), AppLocale\getPrimaryLocale(), and DAO\retrieve().

& ArticleDAO::getBySetting (   $settingName,
  $settingValue,
  $journalId = null,
  $rangeInfo = null 
)

Find articles by querying article settings.

Parameters
$settingNamestring
$settingValuemixed
$journalIdint optional
$rangeInfoDBResultRange optional
Returns
array The articles identified by setting.

Definition at line 145 of file ArticleDAO.inc.php.

References AppLocale\getLocale(), AppLocale\getPrimaryLocale(), and DAO\retrieveRange().

ArticleDAO::getInsertArticleId ( )

Get the ID of the last inserted article.

Returns
int

Definition at line 740 of file ArticleDAO.inc.php.

References DAO\getInsertId().

Referenced by insertArticle().

ArticleDAO::getLocaleFieldNames ( )

Get a list of field names for which data is localized.

Returns
array

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

ArticleDAO::incompleteSubmissionExists (   $articleId,
  $userId,
  $journalId 
)

Check if the specified incomplete submission exists.

Parameters
$articleIdint
$userIdint
$journalIdint
Returns
int the submission progress

Definition at line 576 of file ArticleDAO.inc.php.

References DAO\retrieve().

ArticleDAO::insertArticle ( $article)

Insert a new Article.

Parameters
$articleArticle

Definition at line 241 of file ArticleDAO.inc.php.

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

ArticleDAO::pubIdExists (   $pubIdType,
  $pubId,
  $articleId,
  $journalId 
)

Checks if public identifier exists (other than for the specified article ID, which is treated as an exception).

Parameters
$pubIdTypestring One of the NLM pub-id-type values or 'other::something' if not part of the official NLM list (see http://dtd.nlm.nih.gov/publishing/tag-library/n-4zh0.html).
$pubIdstring
$articleIdint An ID to be excluded from the search.
$journalIdint
Returns
boolean

Definition at line 681 of file ArticleDAO.inc.php.

References DAO\retrieve().

ArticleDAO::removeArticlesFromSection (   $sectionId)

Removes articles from a section by section ID

Parameters
$sectionIdint

Definition at line 703 of file ArticleDAO.inc.php.

References DAO\update().

ArticleDAO::updateArticle ( $article)

Update an existing article.

Parameters
$articleArticle

Definition at line 288 of file ArticleDAO.inc.php.

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

ArticleDAO::updateLocaleFields ( $article)

Update the settings for this object

Parameters
$articleobject

Definition at line 74 of file ArticleDAO.inc.php.

References DAO\updateDataObjectSettings().

Referenced by insertArticle(), and updateArticle().

ArticleDAO::updateSetting (   $articleId,
  $name,
  $value,
  $type,
  $isLocalized = false 
)

Add/update an article setting.

Parameters
$articleIdint
$namestring
$valuemixed
$typestring Data type of the setting.
$isLocalizedboolean

Definition at line 610 of file ArticleDAO.inc.php.

References DAO\convertToDB(), DAO\replace(), and DAO\update().

Referenced by changePubId().


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