From 8a635325ad558d18a2c6930a67e14f5312e91424 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 23 Feb 2011 17:56:38 +0100 Subject: [PATCH] Dokumentationsupdate. --- SL/Helper/Csv.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/SL/Helper/Csv.pm b/SL/Helper/Csv.pm index 82e570115..092ba37e8 100644 --- a/SL/Helper/Csv.pm +++ b/SL/Helper/Csv.pm @@ -55,7 +55,6 @@ sub parse { $self->_open_file; return if ! $self->_check_header; return if ! $self->dispatcher->parse_profile; -# return if $self->class && ! $self->_check_header_for_class; return if ! $self->_parse_data; $self->_parsed(1); @@ -290,6 +289,22 @@ May be used to map header fields to custom accessors. Example: In this case C will be used to read in values from the C column. +In case of a One-To-One relationsship these can also be set over +relationsships by sparating the steps with a dot (C<.>). This will work: + + { customer => customer.name } + +And will result in something like this: + + $obj->customer($obj->meta->relationship('customer')->class->new); + $obj->customer->name($csv_line->{customer}) + +But beware, this will not try to look up anything in the database. You will +simply receive objects that represent what the profile defined. If some of +these information are unique, and should be connected to preexisting data, you +will have to do that for yourself. Since you provided the profile, it is +assumed you know what to do in this case. + =item C If present, the line will be handed to the new sub of this class, -- 2.20.1