Solstice::Factory - Solstice::Factory documentation


Solstice documentation Contained in the Solstice distribution.

Index


Code Index:

NAME

Top

Solstice::Factory -

SYNOPSIS

Top

DESCRIPTION

Top

Export

None by default.

Methods

createByID($id)
createByIDs(\@list)
createByOwner($person)
createHashByIDs(\@list)

AUTHOR

Top

Educational Technology Development Group <catalyst@u.washington.edu>

VERSION

Top

$Revision: 597 $

SEE ALSO

Top

Solstice::List.

COPYRIGHT

Top


Solstice documentation Contained in the Solstice distribution.
package Solstice::Factory;

use 5.006_000;
use strict;
use warnings;

use base qw(Solstice);

use Solstice::List;

sub createByID {
    my $self = shift;
    my $id = shift;
    return $self->createByIDs([$id])->shift();
}

sub createByIDs {
    my $self = shift;
    my $array_ref = shift;
    warn((ref $self).'->createByIDs(): Not implemented');
    return Solstice::List->new();
}

sub createByOwner {
    my $self = shift;
    my $person = shift;
    warn(ref $self.'->createByOwner(): Not implemented');
    return Solstice::List->new();
}

sub createHashByIDs {
    my $self = shift;
    my $ids  = shift || [];
    my %hash = ();

    return \%hash unless @$ids;

    my $iterator = $self->createByIDs($ids)->iterator();
    while (my $obj = $iterator->next()) {
        $hash{$obj->getID()} = $obj;
    }
    return \%hash;
}

1;

__END__