1User::Identity::LocatioUns(e3r)Contributed Perl DocumentUasteiro:n:Identity::Location(3)
2
3
4
6 User::Identity::Location - physical location of a person
7
9 User::Identity::Location
10 is an User::Identity::Item
11
13 use User::Identity;
14 use User::Identity::Location;
15 my $me = User::Identity->new(...);
16 my $addr = User::Identity::Location->new(...);
17 $me->add(location => $addr);
18
19 # Simpler
20
21 use User::Identity;
22 my $me = User::Identity->new(...);
23 my $addr = $me->add(location => ...);
24
26 The "User::Identity::Location" object contains the description of a
27 physical location of a person: home, work, travel. The locations are
28 collected by a User::Identity::Collection::Locations object.
29
30 Nearly all methods can return "undef". Some methods produce language
31 or country specific output.
32
33 Extends "DESCRIPTION" in User::Identity::Item.
34
36 Extends "METHODS" in User::Identity::Item.
37
38 Constructors
39 Extends "Constructors" in User::Identity::Item.
40
41 User::Identity::Location->new( [$name], %options )
42 Create a new location. You can specify a name as first argument,
43 or in the OPTION list. Without a specific name, the organization
44 is used as name.
45
46 -Option --Defined in --Default
47 country undef
48 country_code undef
49 description User::Identity::Item undef
50 fax undef
51 name User::Identity::Item <required>
52 organization undef
53 parent User::Identity::Item undef
54 pc undef
55 phone undef
56 pobox undef
57 pobox_pc undef
58 postal_code <value of option pc>
59 state undef
60 street undef
61
62 country => STRING
63 country_code => STRING
64 description => STRING
65 fax => STRING|ARRAY
66 name => STRING
67 organization => STRING
68 parent => OBJECT
69 pc => STRING
70 Short name for "postal_code".
71
72 phone => STRING|ARRAY
73 pobox => STRING
74 pobox_pc => STRING
75 postal_code => STRING
76 state => STRING
77 street => STRING
78
79 Attributes
80 Extends "Attributes" in User::Identity::Item.
81
82 $obj->city()
83 The city where the address is located.
84
85 $obj->country()
86 The country where the address is located. If the name of the
87 country is not known but a country code is defined, the name will
88 be looked-up using Geography::Countries (if installed).
89
90 $obj->countryCode()
91 Each country has an ISO standard abbreviation. Specify the country
92 or the country code, and the other will be filled in automatically.
93
94 $obj->description()
95 Inherited, see "Attributes" in User::Identity::Item
96
97 $obj->fax()
98 One or more fax numbers, like phone().
99
100 $obj->fullAddress()
101 Create an address to put on a postal mailing, in the format as
102 normal in the country where it must go to. To be able to achieve
103 that, the country code must be known. If the city is not specified
104 or no street or pobox is given, undef will be returned: an
105 incomplete address.
106
107 example:
108
109 print $uil->fullAddress;
110 print $user->find(location => 'home')->fullAddress;
111
112 $obj->name( [$newname] )
113 Inherited, see "Attributes" in User::Identity::Item
114
115 $obj->organization()
116 The organization (for instance company) which is related to this
117 location.
118
119 $obj->phone()
120 One or more phone numbers. Please use the international notation,
121 which starts with '+', for instance "+31-26-12131". In scalar
122 context, only the first number is produced. In list context, all
123 numbers are presented.
124
125 $obj->pobox()
126 Post Office mail box specification. Use "P.O.Box 314", not simple
127 314.
128
129 $obj->poboxPostalCode()
130 The postal code related to the Post-Office mail box. Defined by
131 new() option "pobox_pc".
132
133 $obj->postalCode()
134 The postal code is very country dependent. Also, the location of
135 the code within the formatted string is country dependent.
136
137 $obj->state()
138 The state, which is important for some countries but certainly not
139 for the smaller ones. Only set this value when you state has to
140 appear on printed addresses.
141
142 $obj->street()
143 Returns the address of this location. Since Perl 5.7.3, you can
144 use unicode in strings, so why not format the address nicely?
145
146 Collections
147 Extends "Collections" in User::Identity::Item.
148
149 $obj->add($collection, $role)
150 Inherited, see "Collections" in User::Identity::Item
151
152 $obj->addCollection( $object | <[$type], %options> )
153 Inherited, see "Collections" in User::Identity::Item
154
155 $obj->collection($name)
156 Inherited, see "Collections" in User::Identity::Item
157
158 $obj->parent( [$parent] )
159 Inherited, see "Collections" in User::Identity::Item
160
161 $obj->removeCollection($object|$name)
162 Inherited, see "Collections" in User::Identity::Item
163
164 $obj->type()
165 User::Identity::Location->type()
166 Inherited, see "Collections" in User::Identity::Item
167
168 $obj->user()
169 Inherited, see "Collections" in User::Identity::Item
170
171 Searching
172 Extends "Searching" in User::Identity::Item.
173
174 $obj->find($collection, $role)
175 Inherited, see "Searching" in User::Identity::Item
176
178 Error: $object is not a collection.
179 The first argument is an object, but not of a class which extends
180 User::Identity::Collection.
181
182 Error: Cannot load collection module for $type ($class).
183 Either the specified $type does not exist, or that module named
184 $class returns compilation errors. If the type as specified in the
185 warning is not the name of a package, you specified a nickname
186 which was not defined. Maybe you forgot the 'require' the package
187 which defines the nickname.
188
189 Error: Creation of a collection via $class failed.
190 The $class did compile, but it was not possible to create an object
191 of that class using the options you specified.
192
193 Error: Don't know what type of collection you want to add.
194 If you add a collection, it must either by a collection object or a
195 list of options which can be used to create a collection object.
196 In the latter case, the type of collection must be specified.
197
198 Warning: No collection $name
199 The collection with $name does not exist and can not be created.
200
202 This module is part of User-Identity distribution version 1.00, built
203 on October 14, 2020. Website: http://perl.overmeer.net/CPAN/
204
206 Copyrights 2003-2020 by [Mark Overmeer <markov@cpan.org>]. For other
207 contributors see ChangeLog.
208
209 This program is free software; you can redistribute it and/or modify it
210 under the same terms as Perl itself. See http://dev.perl.org/licenses/
211
212
213
214perl v5.32.1 2021-01-27 User::Identity::Location(3)