Changeset 22828
- Timestamp:
- 09/09/10 10:43:33 (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mnw21/pathquery_refactor/intermine/perl/lib/InterMine/Query/Handler.pm
r22613 r22828 34 34 is => 'rw', 35 35 isa => HashRef, 36 ); 37 38 has current_node => ( 39 is => 'ro', 40 writer => 'set_current_node', 41 clearer => 'clear_current_node', 42 isa => Str, 36 43 ); 37 44 … … 101 108 elsif ($args->{Name} eq 'node') { 102 109 my $path = $args->{Attributes}{path}; 103 $self-> {current_node} = $path;110 $self->set_current_node($path); 104 111 $query->add_constraint( 105 112 path => $path, … … 146 153 $self->query->add_constraint(%args); 147 154 } 155 elsif ($name eq 'node') { 156 $self->clear_current_node; 157 } 148 158 $self->pop_element; 149 159 } … … 152 162 my $self = shift; 153 163 my $attr = $self->current_constraint_attr; 154 my %args = (path => ($attr->{path} || $self->{current_node}) ); 164 confess "Constraint element cannot have a path attribute inside a node" 165 if ($attr->{path} and $self->current_node); 166 my %args = (path => ($attr->{path} || $self->current_node) ); 155 167 $args{code} = $attr->{code} if $attr->{code}; 156 168 $args{op} = $attr->{op} if $attr->{op};
Note: See TracChangeset
for help on using the changeset viewer.
