1SearchBuilder::Union(3)User Contributed Perl DocumentatioSnearchBuilder::Union(3)
2
3
4
6 DBIx::SearchBuilder::Union - Deal with multiple SearchBuilder result
7 sets as one
8
10 use DBIx::SearchBuilder::Union;
11 my $U = new DBIx::SearchBuilder::Union;
12 $U->add( $tickets1 );
13 $U->add( $tickets2 );
14
15 $U->GotoFirstItem;
16 while (my $z = $U->Next) {
17 printf "%5d %30.30s\n", $z->Id, $z->Subject;
18 }
19
21 This module is still experimental.
22
24 Implements a subset of the DBIx::SearchBuilder collection methods, but
25 enough to do iteration over a bunch of results. Useful for displaying
26 the results of two unrelated searches (for the same kind of objects) in
27 a single list.
28
30 new
31
32 Create a new DBIx::SearchBuilder::Union object. No arguments.
33
34 add $sb
35
36 Add a searchbuilder result (collection) to the Union object.
37
38 It must be the same type as the first object added.
39
40 First
41
42 Return the very first element of the Union (which is the first element
43 of the first Collection). Also reset the current pointer to that ele‐
44 ment.
45
46 Next
47
48 Return the next element in the Union.
49
50 Last
51
52 Returns the last item
53
54 Count
55
56 Returns the total number of elements in the Union'ed Collection
57
58 GotoFirstItem
59
60 Starts the recordset counter over from the first item. the next time
61 you call Next, you'll get the first item returned by the database, as
62 if you'd just started iterating through the result set.
63
64 IsLast
65
66 Returns true if the current row is the last record in the set.
67
68 ItemsArrayRef
69
70 Return a refernece to an array containing all objects found by this
71 search.
72
73 Will destroy any positional state.
74
76 Copyright (c) 2004 Robert Spier
77
78 All rights reserved.
79
80 This library is free software; you can redistribute it and/or modify it
81 under the same terms as Perl itself.
82
84 DBIx::SearchBuilder
85
86
87
88perl v5.8.8 2007-02-17 SearchBuilder::Union(3)