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