[Bio] / Sprout / ERDBObject.pm Repository:
ViewVC logotype

Diff of /Sprout/ERDBObject.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2, Mon Jun 11 18:52:07 2007 UTC revision 1.3, Mon Jul 16 20:04:51 2007 UTC
# Line 177  Line 177 
177      Tracer::AddToListMap($fields, $name, @values);      Tracer::AddToListMap($fields, $name, @values);
178  }  }
179    
180    =head3 PrimaryValue
181    
182    C<< my $value = $dbObject->PrimaryValue($name); >>
183    
184    Return the primary value of a field. This will be its first value in a standard value list.
185    
186    This method is a more convenient version of L</Value>. Basically, the call
187    
188        my ($value) = $dbObject->Value($name);
189    
190    is equivalent to
191    
192        my $value = $dbObject->PrimaryValue($name);
193    
194    but the latter is syntactically more convenient.
195    
196    =over 4
197    
198    =item name
199    
200    Name of the field whose value is desired, in the standard form.
201    
202    =item RETURN
203    
204    Returns the value of the specified field, or C<undef> if the field has no value.
205    
206    =back
207    
208    =cut
209    
210    sub PrimaryValue {
211        # Get the parameters.
212        my ($self, $name) = @_;
213        # Get the value.
214        my ($retVal) = $self->Value($name);
215        # Return it.
216        return $retVal;
217    }
218    
219  =head3 Value  =head3 Value
220    
221  C<< my @values = $dbObject->Value($attributeName); >>  C<< my @values = $dbObject->Value($attributeName); >>
# Line 341  Line 380 
380          $targetEntity = $relationship->{from};          $targetEntity = $relationship->{from};
381      }      }
382      # Get the ID of the starting instance.      # Get the ID of the starting instance.
383      my ($id) = $self->Value("$startingEntity(id)");      my $id = $self->PrimaryValue("$startingEntity(id)");
384      # Create the WHERE clause.      # Create the WHERE clause.
385      my $superFilter = "$startLinkName = ?";      my $superFilter = "$startLinkName = ?";
386      # Analyze the filter clause. We need to pull out any strings and put them in parameters.      # Analyze the filter clause. We need to pull out any strings and put them in parameters.

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3