App::160::SQL

DESCRIPTION

Functions above SQL database to manipulate with relations

FUNCTIONS

new_relation()

Creates a new relation and return ID_entity, ID

my ($ID_entity,$ID)=new_relation(
  'l_prefix' => 'a400',
  'l_table' => '',
  'l_ID_entity' => '2',
  #'rel_type' => '', # relation type
  #'r_db_name' => 'example_tld',
  #'r_prefix' => 'a210',
  #'r_table' => 'page',
  #'r_ID_entity' => '2'
);

remove_relation()

Removes relation and return true/false

my $output=remove_relation(
  'ID' => $ID
);

relation_change_status()

Changes relation status

my $output=relation_change_status(
  'ID' => $ID,
  'status' => 'Y'
);

get_relations()

Returns list of references to relations

my @list=get_relations(
  #'ID' => 1,
  #'ID_entity' => 1,
  #'db_h' => 'main',
  #'db_name' => $App::160::db_name,
  'l_prefix' => 'a400',
  'l_table' => '',
  'l_ID_entity' => '2'
  #'r_db_name' => 'example_tld',
  #'r_prefix' => 'a210',
  #'r_table' => 'page',
  #'r_ID_entity' => '2'
);
foreach $reference (@list)
{
 main::_log("reference with ID='$reference->{'ID'}'");
}

get_relation_iteminfo

Return information hash of relation right table, also about concrete entity

my %info=get_relation_iteminfo(
   lng => 'en' # get this language if support
  'r_db_name' => 'example_tld',
  'r_prefix' => 'a210',
  'r_table' => 'page',
  'r_ID_entity' => '2',
);

main::_log("name of relation = '$info{name}'");

AUTHORS

Comsultia, Ltd. (open@comsultia.com)

User Comments


AddThis Social Bookmark Button RSS

This content is generated from file 'http://svn.cyclone3.org/trunk/frame/_addons/App/160/SQL.pm'

Connect any database you want with Perl DBI interface. Integrate any third-party software.