Revision 8a635325
Von Sven Schöling vor mehr als 13 Jahren hinzugefügt
SL/Helper/Csv.pm | ||
---|---|---|
55 | 55 |
$self->_open_file; |
56 | 56 |
return if ! $self->_check_header; |
57 | 57 |
return if ! $self->dispatcher->parse_profile; |
58 |
# return if $self->class && ! $self->_check_header_for_class; |
|
59 | 58 |
return if ! $self->_parse_data; |
60 | 59 |
|
61 | 60 |
$self->_parsed(1); |
... | ... | |
290 | 289 |
In this case C<listprice_as_number> will be used to read in values from the |
291 | 290 |
C<listprice> column. |
292 | 291 |
|
292 |
In case of a One-To-One relationsship these can also be set over |
|
293 |
relationsships by sparating the steps with a dot (C<.>). This will work: |
|
294 |
|
|
295 |
{ customer => customer.name } |
|
296 |
|
|
297 |
And will result in something like this: |
|
298 |
|
|
299 |
$obj->customer($obj->meta->relationship('customer')->class->new); |
|
300 |
$obj->customer->name($csv_line->{customer}) |
|
301 |
|
|
302 |
But beware, this will not try to look up anything in the database. You will |
|
303 |
simply receive objects that represent what the profile defined. If some of |
|
304 |
these information are unique, and should be connected to preexisting data, you |
|
305 |
will have to do that for yourself. Since you provided the profile, it is |
|
306 |
assumed you know what to do in this case. |
|
307 |
|
|
293 | 308 |
=item C<class> |
294 | 309 |
|
295 | 310 |
If present, the line will be handed to the new sub of this class, |
Auch abrufbar als: Unified diff
Dokumentationsupdate.