71 $this->Database =
get_package(
'database' ,
'last' , __FILE__ );
72 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
112 foreach( $this->LinkTypesDictionary as $k => $v )
114 if( $Object1Type !==
false && $v->object1_type != $Object1Type )
118 if( $Object2Type !==
false && $v->object2_type != $Object2Type )
125 if( isset( $Types[ 0 ] ) )
127 return( implode(
',' , $Types ) );
132 catch( Exception $e )
156 if( $this->LinkTypesDictionary ===
false )
159 $this->LinkTypesDictionary = $this->Database->select(
'*' ,
'umx_link_dictionary' ,
"1 = 1" );
162 catch( Exception $e )
202 catch( Exception $e )
234 $Object1Type = $this->Security->get( $Object1Type ,
'string' );
235 $Object2Type = $this->Security->get( $Object2Type ,
'string' );
237 $this->Database->lock( array(
'umx_link_dictionary' ) , array(
'WRITE' ) );
238 $this->Database->insert(
'umx_link_dictionary' ,
'object1_type , object2_type' ,
239 "'$Object1Type' , '$Object2Type'" );
240 $this->Database->commit();
241 $this->Database->unlock();
243 $this->LinkTypesDictionary =
false;
245 catch( Exception $e )
283 if( $LinkType ===
false )
285 if( $Object1Type ===
false || $Object2Type ===
false )
295 return( $this->
get_link_type( $Object1Type , $Object2Type ) );
303 catch( Exception $e )
335 $Type = is_array( $Type ) ===
true ? $Type : array( $Type );
338 foreach( $this->LinkTypesDictionary as $k => $v )
340 foreach( $Type as $i => $t )
345 'object1_type' => $v->object1_type ,
'object2_type' => $v->object2_type
350 if( isset( $Types[ 0 ] ) ===
false )
352 throw(
new Exception(
'Literal type of the link was not found' ) );
356 catch( Exception $e )