InterMine > Webservice-InterMine > Webservice::InterMine::Query::Core

Download:
Webservice-InterMine-1.0405.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source  

root_path - The root of this query

The starting table for this query.

has_root_path - Whether or not this query has a root set

path($expr) -> Path

Return a Webservice::InterMine::Path object corresponding to the expression passed in (a dotted path string). The path will be made with the subclass information contained in the query.

has_sort_order - whether or not this query has a defined sort-order

push_sort_order - Add a sort order element to the sort order

sort_orders - get the list of sort orders

joined_so($sep) - Join the sort orders with a separator

clear_sort_order - delete all sort order information from the query

sort_order_is_empty - whether or not there are any elements in the sort order list

sort_order - Return the string representing the sort order

add_sort_order(@args) - add a sort order element to this query

order_by(@args) -> $self

Replace any existing sort order by the one defined with the given arguments. Return self to allow method chaining.

prefix_pathfeature - prefix the path of a PathFeature with the query's root.

Used internally to process shortened, headless paths.

prefix_path($path) -> a prefixed path

Used internally to process shortened, headless paths.

to_query

returns self to fulfil the Listable interface.

clone

Return a clone of this query.

DEMOLISH

Called upon object destruction

set_sort_order(@elements) - replace any existing order with the given ones.

view -> ArrayRef

Get the view as an array-ref

views -> list

Get the paths that make up the output columns (the view)

get_view($index) -> path

Get the view at the specified index

joined_view($sep) -> Str

Get a string consisting of the view paths joined with the given separator.

view_is_empty -> Bool

Return true if the view is currently empty.

clear_view

Clear the current view

view_size -> Int

Get the number of output columns

add_views(@views)

Add the given views to the view list, first preprending the query's root, and checking for validity.

add_view

alias for add_views

add_to_select(@columns)

Alias for add_views

select(@columns)

Clear the current view and replace it with the given columns.

constraints

Get the list of constraints in the order they were added. Returns an arrayref in scalar context, and a list in list context.

all_constraints

Get all constraints as a list, in the order they were added.

map_constraints($coderef) -> list

Apply the coderef to each constraint in turn (ala map) and return the result of each call.

find_constraints($coderef) -> list

Apply the coderef to each constraint in turn (ala grep) and return the constraints for which the code returns a truthy value.

delete_constraint($index)

Delete the constraint with the given index from the list.

count_constraints -> Int

Get the number of constraints on this query.

clear_constraints

Remove all constraints from this query

remove($constraint)

Remove the given object from the query, where the object is a constraint child object (a path-description, a constraint or a join).

remove_constraint($constraint | $code)

Remove the given constraint. If a string is passed instead, it is assumed to be the code for this constraint, and the constraint with the given code is removed instead.

coded_constraints -> list|Int

Return the constraints that have codes and can participate in logic. Returns a list in list context and the size of the list in scalar context.

sub_class_constraints -> list|Int

Return the constraints that constrain object types, and cannot participate in logic. Returns a list in list context and the size of the list in scalar context.

constraint_codes -> list

Return the codes (single characters from 'A' to 'Z') that this query uses.

type_dict -> hashref

returns a hashref with the mapping from class => subclass for all constrained types within the query. This summarises the information from subclass constraints.

subclasses -> list

Return the list of subclasses as constrained in the query.

joins -> arrayref

Return an arrayref of the Webservice::InterMine::Join objects on this query, in the order they were added.

all_joins -> list

Returns the Webservice::InterMine::Join objects of this query as a list in the order they were added to the query.

map_joins($code) -> list

Apply the codereference to each join in the query in turn and return the results of the calls.

clear_joins

Remove all joins from the query

delete_join($index)

Remove the given join from the query.

add_join( $path ) -> $self

Specifies the join style of a path on the query. The default join style this method adds is "OUTER", but it can be specified with path => $path, style => $style. Possible join styles are INNER and OUTER.

outerjoin($path) -> $self

A shortcut for add_join($path, 'OUTER').

add_outer_join( $path )

A shortcut for add_join($path, 'OUTER').

logic -> Logic

Returns the logic object for this query. This object stringifies to the logic expression used in the serialisation.

clear_logic

Remove the current logic from this query

has_logic

Return true if this query has logic set for it.

set_logic($expr) -> self

Sets the logic for this query, validating it in the process. Returns self to support chaining.

  $query->set_logic("A or B and C");

constraint_factory

The object responsible for making constraints for this query.

add_constraint(@args) -> constraint

Adds a constraint corresponding to the given arguments, and returns the new constraint.

  $query->add_constraint('name', '=', 'foo');
  $query->add_constraint(age => {lt => 50});

search($constraints) -> self|results

Add the given constraints to the query, where those constraints are specified with an array-reference or a hash-reference. In list context return the result of the query. In scalar context, return the query for chaining.

This method is similar in interface to the method of the same name in DBIx::Class::ResultSet.

where(@constraints) -> $self

Add the given constraints to the query, and return self to support chaining

  $query->where(
    name     => "foo",
    fullTime => 'true',
    age      => {gt => 10},
    'department.name'    => ['Sales', 'Accounting'],
    'department.company' => {lookup => 'Foo'},
  );

parse_constraint_string

Interpret the constraint arguments so that constraints can be constructed while allowing multiple representations of constraints to be understood.

clean_out_SCCs

Remove pointless subclass constraints from the query.

to_string

Return a readable representation of the query.

AND

OR

syntax highlighting: