Lines 173-188
Generates the DBIC join attribute based on extended_attributes query entries, an
Link Here
|
173 |
|
173 |
|
174 |
my $attributes = $args->{attributes}; |
174 |
my $attributes = $args->{attributes}; |
175 |
my $filtered_params = $args->{filtered_params}; |
175 |
my $filtered_params = $args->{filtered_params}; |
|
|
176 |
my $result_set = $args->{result_set}; |
176 |
|
177 |
|
177 |
if ( reftype( $attributes->{prefetch} ) |
178 |
if ( reftype( $attributes->{prefetch} ) |
178 |
&& reftype( $attributes->{prefetch} ) eq 'ARRAY' |
179 |
&& reftype( $attributes->{prefetch} ) eq 'ARRAY' |
179 |
&& grep ( /extended_attributes/, @{ $attributes->{prefetch} } ) ) |
180 |
&& grep ( /extended_attributes/, @{ $attributes->{prefetch} } ) ) |
180 |
{ |
181 |
{ |
181 |
my $ea_entries = $self->_get_extended_attributes_entries( $filtered_params, 0 ); |
182 |
# my $ea_entries = $self->_get_extended_attributes_entries( $filtered_params, 0 ); |
182 |
while ( $ea_entries > 0 ) { |
183 |
|
183 |
push( @{ $attributes->{join} }, 'extended_attributes' ); |
184 |
# Calling our private method to build the extended attributes relations |
184 |
$ea_entries--; |
185 |
$result_set->_build_extended_attributes_relations(); |
|
|
186 |
|
187 |
# Testing out the extended attributes join (hardcoded for now) |
188 |
my @test = qw( extended_attributes_article_title extended_attributes_issue extended_attributes_volume ); |
189 |
foreach my $test (@test) { |
190 |
push( @{ $attributes->{join} }, $test ); |
185 |
} |
191 |
} |
|
|
192 |
|
193 |
# while ( $ea_entries > 0 ) { |
194 |
# push( @{ $attributes->{join} }, 'extended_attributes_title' ); |
195 |
# push( @{ $attributes->{join} }, 'extended_attributes_author' ); |
196 |
# $ea_entries--; |
197 |
# } |
198 |
|
186 |
} |
199 |
} |
187 |
} |
200 |
} |
188 |
); |
201 |
); |
Lines 630-640
sub _rewrite_related_metadata_query {
Link Here
|
630 |
$extended_attributes_entries++; |
643 |
$extended_attributes_entries++; |
631 |
if ( $extended_attributes_entries > 1 ) { |
644 |
if ( $extended_attributes_entries > 1 ) { |
632 |
my $old_key_value = delete $params->{ 'extended_attributes.' . $key }; |
645 |
my $old_key_value = delete $params->{ 'extended_attributes.' . $key }; |
633 |
my $new_key_value = "extended_attributes_$extended_attributes_entries" . "." . $key; |
646 |
my $new_key_value = "extended_attributes_$key" . "." . $key; |
634 |
$params->{$new_key_value} = $old_key_value; |
647 |
$params->{$new_key_value} = $old_key_value; |
635 |
|
648 |
|
636 |
my $old_value_value = delete $params->{ 'extended_attributes.' . $value }; |
649 |
my $old_value_value = delete $params->{ 'extended_attributes.' . $value }; |
637 |
my $new_value_value = "extended_attributes_$extended_attributes_entries" . "." . $value; |
650 |
my $new_value_value = "extended_attributes_$key" . "." . $value; |
638 |
$params->{$new_value_value} = $old_value_value; |
651 |
$params->{$new_value_value} = $old_value_value; |
639 |
} |
652 |
} |
640 |
|
653 |
|
641 |
- |
|
|