diff --git a/classes/publication/PKPPublicationDAO.inc.php b/classes/publication/PKPPublicationDAO.inc.php index 6646ffbd9de..3cf47edd619 100644 --- a/classes/publication/PKPPublicationDAO.inc.php +++ b/classes/publication/PKPPublicationDAO.inc.php @@ -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(); + } }