NAME

Litigation::Database::Relationship - Relationship between two objects stored in the Litigation::Database system.

SYNOPSIS

  foreach my $item (@{$obj->get_Items_Of()}){
    my $rel = $item->{rel};
    print $item->{obj}->get_t() . " is connected to " . $obj->get_t()
      . " with relationship ID " . $rel->get_id() . "\n";
  }

DESCRIPTION

In Litigation::Database, objects are connected by relationships. Every relationship has a relationship type, like "Employee Of." A relationship connects a parent object to a child object. A relationship can optionally have a relationship object that stores additional information about the relationship.

Relationships go in two directions. The parent-to-child relationship is known as the forward direction, and the child-to-parent relationship is known as the backward direction.

In Perl, a relationship is represented by a Litigation::Database::Relationship, while a relationship object is represented by an object that inherits from Litigation::Database::Object::Relationship. Relationship objects have package names that indicate the type of relationship, such as Litigation::Database::Object::Person::EmployeeOf. The first part of the package name indicates the parent object.

INTERFACE

Methods

$rel->save()
$rel->is_artificial()
$rel->set_artificial()
$rel->get_child_object_of()
$rel->get_parent_object_of()
$rel->get_bare_prop_object_of()
$rel->get_prop_object()
$rel->get_prop_object_if_exists()
( $found, $output ) = $rel->trigger( $method, $args, $output_ref )

See Triggers.

( $found, $output ) = $rel->trigger_up( $args, $output_ref )

See Triggers.

$rel->slay_other_relns_of_child()
$rel->slay_other_relns_of_parent()

Low-level interface

Litigation::Database::Relationship->new( \%args )
$rel->set_values( \%args )
$rel->fetch_values( $flags )
$rel->save( \%unused, $save_modtime )
$rel->set_db( $db )
$rel->get_id()
$rel->set_id( $id )
$rel->remove()
$rel->get_owner()
$rel->set_owner( $owner_id )
$rel->get_perms()
$rel->get_group()
$rel->set_group( $group_id )
$rel->get_modtime()
$rel->set_modtime( $epoch_seconds )
$rel->get_parent_id()
$rel->set_parent_id( $id )
$rel->get_child_id()
$rel->set_prop_id()
$rel->get_type()
$rel->set_type( $type_id )
$rel->get_sort_pos_c()
$rel->set_sort_pos_c( $sort_pos )
$rel->get_sort_pos_p()
$rel->set_sort_pos_p( $sort_pos )
$rel->get_prop_node_if_exists()
$rel->get_prop_node()
$rel->get_prop_id_for_use()
$rel->change_prop_id_to()
$rel->can_read()
$rel->can_write()
$rel->can_execute()
$rel->change_parent_and_type_of_rel( $parent_id, $type_id )
$rel->change_child_and_type_of_rel( $child_id, $type_id )
$rel->alter_rel( $child_id, $parent_id, $type_id )
$rel->fetch_values_of_nodes()
$rel->delete_rel()
$rel->get_array( $is_forward )

AUTHOR

Jonathan Pyle <jpyle@litigationdatabase.org>

LICENCE AND COPYRIGHT

Copyright (c) 2007-2014, Jonathan Pyle <jpyle@litigationdatabase.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.