| User::Identity::Item(3pm) | User Contributed Perl Documentation | User::Identity::Item(3pm) |
User::Identity::Item - general base class for User::Identity
User::Identity::Item is extended by Mail::Identity User::Identity User::Identity::Archive User::Identity::Collection User::Identity::Location User::Identity::System
The "User::Identity::Item" base class is extended into useful modules: it has no use by its own.
-Option --Default
description undef
name <required>
parent undef
Changing the name of an item is quite dangerous. You probably want to call User::Identity::Collection::renameRole() instead.
The $role is anything what is acceptable to User::Identity::Collection::addRole() of the collection at hand, and is returned. $role typically is a list of parameters for one role, or a reference to an array containing these values.
example:
my $ui = User::Identity->new(...);
my $home = $ui->add(location => [home => street => '27 Roadstreet', ...] );
my $work = $ui->add(location => work, tel => '+31-2231-342-13', ... );
my $travel = User::Identity::Location->new(travel => ...);
$ui->add(location => $travel);
my $system = User::Identity::Collection::System->new(...);
$ui->add($system => 'localhost');
For %options, see the specific type of collection. Additional options are listed below.
-Option--Default
type <required>
example:
my $me = User::Identity->new(...);
my $locs = User::Identity::Collection::Locations->new();
$me->addCollection($locs);
my $email = $me->addCollection(type => 'email');
my $email = $me->addCollection('email');
example:
my @roles = $me->collection('email'); # list of collected items
my @roles = $me->collection('email')->roles; # same of collected items
my $coll = $me->collection('email'); # a User::Identity::Collection
example:
print $email->user->fullName;
example:
my $role = $me->find(location => 'work'); # one location
my $role = $me->collection('location')->find('work'); # same
my $email = $me->addCollection('email');
$me->find($email => 'work');
$email->find('work'); # same
This module is part of User-Identity distribution version 0.99, built on January 24, 2018. Website: http://perl.overmeer.net/CPAN/
Copyrights 2003-2018 by [Mark Overmeer]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
| 2018-03-18 | perl v5.26.1 |