Package DE_EPAGES::Search::API::Object::PagerSearch
object interface for Search.
Base |
DE_EPAGES::Presentation::API::Object::Pager |
Example |
# without Servlet my $ProductClass = LoadClassByAlias('Product'); my $SearchDefinition = GetSearchDefinition($ProductClass, 'MBO-AllStrings'); my $Search = DE_EPAGES::Search::API::Object::PagerSearch->new({ 'SearchDefinition' => $SearchDefinition, 'ObjectID' => $Shop->id, 'OrderBy' => 'Alias', 'Parameters' => { 'Shop.ID' => $Shop->id, 'SearchLanguageID' => $LanguageID, 'NameAttributeID' => $ProductClass->attribute('Name')->id, 'SearchString' => $SearchString, }, }); my $aProducts = $Search->allItems; # with Servlet my $ProductClass = LoadClassByAlias('Product'); my $SearchDefinition = GetSearchDefinition($ProductClass, 'MBO-AllStrings'); my $Search = DE_EPAGES::Search::API::Object::PagerSearch->new({ 'SearchDefinition' => $SearchDefinition, 'Servlet' => $Servlet, 'OrderBy' => 'Alias', 'Parameters' => { 'Shop.ID' => $Shop->id, 'SearchLanguageID' => $LanguageID, 'NameAttributeID' => $ProductClass->attribute('Name')->id, 'SearchString' => $SearchString, }, 'UriParameters' => { 'Search' => 'MBO-AllStrings', }, }); $Servlet->vars('Pager', $Search->page->{'Pager'}); |
@EXPORT_OK |
Functions
- ReplaceWildcards
- allItemIDs
- allItems
- countItems
- execute
- items
- new
- sqlFrom
- sqlLimit
- sqlSelect
- sqlSort
- sqlWhere
- statistic
ReplaceWildcards
replaces * with % and adds on begin and end a %.
Syntax |
my $SQLString = ReplaceWildcards($SearchString); |
Input |
|
Return |
|
allItemIDs
Returns the object id of all found objects of all pages.
Syntax |
$aItemIDs = $Pager->allItemIDs; |
Return |
|
allItems
Returns all objects of all pages.
Syntax |
$aItems = $Pager->allItems; |
Return |
|
countItems
returns how many items should be paged.
Syntax |
$Object->countItems; |
Return |
|
execute
executes the search.
Syntax |
$Object = $Package->execute($PageNumber); |
Input |
|
items
load all objects of a page.
Syntax |
my $aItems = $Object->items($PageNumber); |
Input |
|
Return |
|
new
Creates a new search pager object.
Syntax |
$Pager = $Package->new($hInfo); |
Input |
|
Return |
|
sqlFrom
returns the from part of sql statement
Syntax |
my $From = $Object->sqlFrom; |
Return |
|
sqlLimit
returns the limit part of the sql statement for result columns. Returns '' if $PageNumber is 0.
Syntax |
my $Limit = $Object->sqlLimit($PageNumber); |
Input |
|
Return |
|
sqlSelect
returns the select part of the sql statement for result columns
Syntax |
my $Select = $Object->sqlSelect; |
Return |
|
sqlSort
returns the OrderBy part of sql statement
Syntax |
my $OrderBy = $Object->sqlSort; |
Return |
|
sqlWhere
returns the where part of sql statement
Syntax |
my $Where = $Object->sqlWhere; |
Return |
|
statistic
Calls countPages and countItems to collect required information for all pages.
Syntax |
$Pager->statistic; |