Skip to content

Commit

Permalink
pkp/pkp-lib#10178 Allow search by DOI in DOI manager
Browse files Browse the repository at this point in the history
  • Loading branch information
taslangraham committed Dec 18, 2024
1 parent 2fb914a commit a09ceda
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions classes/submission/Collector.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @file classes/submission/Collector.php
*
Expand Down Expand Up @@ -101,4 +102,22 @@ protected function addHasDoisFilterToQuery(Builder $q)
});
});
}

/** @copydoc PKP/classes/submission/Collector::addFilterByAssociatedDoiIdsToQuery() */
protected function addFilterByAssociatedDoiIdsToQuery(Builder $q)
{
$q->whereIn('s.submission_id', function (Builder $query) {
$query->select('p.submission_id')
->from('publication_galleys AS g')
->join('dois AS d', 'g.doi_id', '=', 'd.doi_id')
->join('publications AS p', 'g.publication_id', '=', 'p.publication_id')
->whereLike('d.doi', "{$this->searchPhrase}%")
->union(function (Builder $query) {
$query->select('p.submission_id')
->from('publications AS p')
->join('dois AS d', 'p.doi_id', '=', 'd.doi_id')
->whereLike('d.doi', "{$this->searchPhrase}%");
});
});
}
}

0 comments on commit a09ceda

Please sign in to comment.