Signed-off-by: Francois Gouget fgouget@codeweavers.com ---
For the next patch.
testbot/lib/ObjectModel/Collection.pm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/testbot/lib/ObjectModel/Collection.pm b/testbot/lib/ObjectModel/Collection.pm index d4418603..c3bc438c 100644 --- a/testbot/lib/ObjectModel/Collection.pm +++ b/testbot/lib/ObjectModel/Collection.pm @@ -373,6 +373,28 @@ sub GetItems($) =pod =over 12
+=item C<GetItemsCount()> + +Returns how many Items are present in the Collection. + +=back +=cut + +sub GetItemsCount($) +{ + my ($self) = @_; + + if (! $self->{Loaded}) + { + $self->Load(); + } + + return scalar(keys %{$self->{Items}}); +} + +=pod +=over 12 + =item C<IsEmpty()>
Returns true if the Collection contains no Item.