NAME
InterMine::Item - Representation of InterMine items
SYNOPSIS
my $factory = new InterMine::ItemFactory(model => $model);
my $gene = $factory->make_item("Gene");
$gene->set("identifier", "CG10811");
(See InterMine::ItemFactory for a longer Synopsis)
AUTHOR
FlyMine <support@flymine.org>
BUGS
Please report any bugs or feature requests to support@flymine.org
.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc InterMine::Item
You can also look for information at:
FlyMine
Documentation
COPYRIGHT & LICENSE
Copyright 2006,2007,2008 FlyMine, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
FUNCTIONS
new
Title : new
Usage : $item = $factory->make_item("Gene"); # calls Item->new() implicitly
Function: create a new Item
Args : model - the InterMine::Model object to use to check field validity
Note : use this method indirectly using an ItemFactory
set
Title : set
Usage : $gene_item->set("name", "wtf7");
or: $gene_item->set("organism", $organism_item);
Function: set a field in the Item, checking that this object can have a field
with that name
Args : $name - the name of the field to set
$value - the new value (must not be undefined)
get
Title : get
Usage : $gene_name = $gene_item->get("name");
or: $organism_item = $gene_item->get("organism");
Function: get the value of a field from an Item
Args : $name - the name of the field to get
Return : the value
model
Title : model
Usage : $model = $item->model();
Function: return the model that this Item obeys
classname
Title : classname
Usage : $classname = $item->classname();
Function: return the class name of this Item - ie the class name that will be
used when creating the object in InterMine
classdescriptor
Title : classdescriptor
Usage : $cd = $item->classdescriptor();
Function: return the ClassDescriptor object from the model for this Item
all_class_descriptors
Title : all_class_descriptors
Usage : @cds = $item->all_class_descriptors();
Function: return a list of ClassDescriptor objects from the model for this
Item, including the classdescriptors of all parent objects
valid_field
Title : valid_field
Usage : if ($item->valid_field('someFieldName')) { ... };
Function: return true if and only if the given field name is valid for this
object according to the model
has_field_called
Title : has_field_called
Usage : if ($item->has_field_called('someFieldName')) { ... };
Function: return true if the item has a field slot of the given name.
This is the new and recommended name for "valid_field".
instance_of
Title : instance_of
Usage : my $gene_cd = $model->get_classdescriptor_by_name("Gene");
if ($some_item->instance_of($gene_cd)) { ... }
Function: Return true if and only if this Item represents an object that has
the given class, or is a sub-class.
to_string
Title : to_string
Usage : warn('item: ', $item->to_string());
Function: return a text representation of this Item
as_xml
Title : as_xml
Usage : $xml = $item->as_xml();
Function: return an XML representation of this Item
destroy
Title : destroy
Usage : $item = $item->destroy;
Function: deletes the item object and its contents