Skip to content

Commit

Permalink
Merge pull request #6815 from bozana/4904-3_3_0
Browse files Browse the repository at this point in the history
#4904 fix usage stats
  • Loading branch information
bozana authored Mar 4, 2021
2 parents e80d6f6 + 878976a commit 92f4d4a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions classes/publication/PKPPublicationDAO.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,19 @@ public function getIdsBySetting($settingName, $settingValue, $contextId) {
->pluck('p.publication_id')
->toArray();
}

/**
* Check if the publication ID exists.
* @param $publicationId int
* @param $submissionId int, optional
* @return boolean
*/
function exists($publicationId, $submissionId = null) {
$q = Capsule::table('publications');
$q->where('publication_id', '=', $publicationId);
if ($submissionId) {
$q->where('submission_id', '=', $submissionId);
}
return $q->exists();
}
}

0 comments on commit 92f4d4a

Please sign in to comment.