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
34 Constructors
35
36 User::Identity::Location->new([NAME], OPTIONS)
37
38 Create a new location. You can specify a name as first argument,
39 or in the OPTION list. Without a specific name, the organization
40 is used as name.
41
42 Option --Defined in --Default
43 country undef
44 country_code undef
45 description User::Identity::Item undef
46 fax undef
47 name User::Identity::Item <required>
48 organization undef
49 parent User::Identity::Item undef
50 pc undef
51 phone undef
52 pobox undef
53 pobox_pc undef
54 postal_code <value of option pc>
55 state undef
56 street undef
57
58 . country STRING
59
60 . country_code STRING
61
62 . description STRING
63
64 . fax STRING⎪ARRAY
65
66 . name STRING
67
68 . organization STRING
69
70 . parent OBJECT
71
72 . pc STRING
73
74 Short name for "postal_code".
75
76 . phone STRING⎪ARRAY
77
78 . pobox STRING
79
80 . pobox_pc STRING
81
82 . postal_code STRING
83
84 . state STRING
85
86 . street STRING
87
88 Attributes
89
90 $obj->city
91
92 The city where the address is located.
93
94 $obj->country
95
96 The country where the address is located. If the name of the coun‐
97 try is not known but a country code is defined, the name will be
98 looked-up using Geography::Countries (if installed).
99
100 $obj->countryCode
101
102 Each country has an ISO standard abbreviation. Specify the country
103 or the country code, and the other will be filled in automatically.
104
105 $obj->description
106
107 See "Attributes" in User::Identity::Item
108
109 $obj->fax
110
111 One or more fax numbers, like phone().
112
113 $obj->fullAddress
114
115 Create an address to put on a postal mailing, in the format as nor‐
116 mal in the country where it must go to. To be able to achieve
117 that, the country code must be known. If the city is not specified
118 or no street or pobox is given, undef will be returned: an incom‐
119 plete address.
120
121 Example:
122
123 print $uil->fullAddress;
124 print $user->find(location => 'home')->fullAddress;
125
126 $obj->name([NEWNAME])
127
128 See "Attributes" in User::Identity::Item
129
130 $obj->organization
131
132 The organization (for instance company) which is related to this
133 location.
134
135 $obj->phone
136
137 One or more phone numbers. Please use the internation notation,
138 which starts with '+', for instance "+31-26-12131". In scalar con‐
139 text, only the first number is produced. In list context, all num‐
140 bers are presented.
141
142 $obj->pobox
143
144 Post Office mail box specification. Use "P.O.Box 314", not simple
145 314.
146
147 $obj->poboxPostalCode
148
149 The postal code related to the Post-Office mail box. Defined by
150 new() option "pobox_pc".
151
152 $obj->postalCode
153
154 The postal code is very country dependent. Also, the location of
155 the code within the formatted string is country dependent.
156
157 $obj->state
158
159 The state, which is important for some contries but certainly not
160 for the smaller ones. Only set this value when you state has to
161 appear on printed addresses.
162
163 $obj->street
164
165 Returns the address of this location. Since Perl 5.7.3, you can
166 use unicode in strings, so why not format the address nicely?
167
168 Collections
169
170 $obj->add(COLLECTION, ROLE)
171
172 See "Collections" in User::Identity::Item
173
174 $obj->addCollection(OBJECT ⎪ ([TYPE], OPTIONS))
175
176 See "Collections" in User::Identity::Item
177
178 $obj->collection(NAME)
179
180 See "Collections" in User::Identity::Item
181
182 $obj->find(COLLECTION, ROLE)
183
184 See "Collections" in User::Identity::Item
185
186 $obj->parent([PARENT])
187
188 See "Collections" in User::Identity::Item
189
190 $obj->removeCollection(OBJECT⎪NAME)
191
192 See "Collections" in User::Identity::Item
193
194 $obj->type
195
196 User::Identity::Location->type
197
198 See "Collections" in User::Identity::Item
199
200 $obj->user
201
202 See "Collections" in User::Identity::Item
203
205 Error: $object is not a collection.
206
207 The first argument is an object, but not of a class which extends
208 User::Identity::Collection.
209
210 Error: Cannot load collection module for $type ($class).
211
212 Either the specified $type does not exist, or that module named $class
213 returns compilation errors. If the type as specified in the warning is
214 not the name of a package, you specified a nickname which was not
215 defined. Maybe you forgot the 'require' the package which defines the
216 nickname.
217
218 Error: Creation of a collection via $class failed.
219
220 The $class did compile, but it was not possible to create an object of
221 that class using the options you specified.
222
223 Error: Don't know what type of collection you want to add.
224
225 If you add a collection, it must either by a collection object or a
226 list of options which can be used to create a collection object. In
227 the latter case, the type of collection must be specified.
228
229 Warning: No collection $name
230
231 The collection with $name does not exist and can not be created.
232
234 This module is part of User-Identity distribution version 0.91, built
235 on January 08, 2007. Website: http://perl.overmeer.net/userid/
236
238 Copyrights 2003,2004,2007 by Mark Overmeer <perl@overmeer.net>.For
239 other contributors see Changes.
240
241 This program is free software; you can redistribute it and/or modify it
242 under the same terms as Perl itself. See
243 http://www.perl.com/perl/misc/Artistic.html
244
245
246
247perl v5.8.8 2007-01-08 User::Identity::Location(3)