+=cut
+sub UpdateBorrowerAttribute {
+ my ( $borrowernumber, $attribute ) = @_;
+
+ DeleteBorrowerAttribute $borrowernumber, $attribute;
+
+ my $dbh = C4::Context->dbh;
+ my $query = "INSERT INTO borrower_attributes SET attribute = ?, code = ?, borrowernumber = ?";
+ my @params = ( $attribute->{attribute}, $attribute->{code}, $borrowernumber );
+ if ( defined $attribute->{password} ) {
+ $query .= ", password = ?";
+ push @params, $attribute->{password};
+ }
+ my $sth = $dbh->prepare( $query );
+
+ $sth->execute( @params );
+}
+
+
+=head2 extended_attributes_code_value_arrayref
+
+ my $patron_attributes = "homeroom:1150605,grade:01,extradata:foobar";
+ my $aref = extended_attributes_code_value_arrayref($patron_attributes);