Add a limit option to getMatchingAssets.

This commit is contained in:
Colin Kuskie 2009-04-18 02:21:15 +00:00
parent 7b3ab664fe
commit adc6f803e6

View file

@ -278,6 +278,11 @@ Instead of returning an array reference of assetId's, return a paginator object.
If usePaginator is passed, then this variable will set the number of rows per page that the paginator uses.
=head3 limit
Limit the number of assetIds that are returned. This should not be used in conjunction
with usePaginator.
=cut
sub getMatchingAssets {
@ -328,6 +333,9 @@ sub getMatchingAssets {
my $query = 'select distinct assetKeyword.assetId from assetKeyword left join asset using (assetId)
where '.join(' and ', @clauses).' order by creationDate desc, lineage';
if ($options->{limit}) {
$query .= ' limit '. $options->{limit};
}
# perform the search
if ($options->{usePaginator}) {
my $p = WebGUI::Paginator->new($self->session, undef, $options->{rowsPerPage});