Class RelationHandler

Description

This class handles all the methods to create and validate relations between elements.

Located in /relationHandlerClass.php (line 57)


	
			
Method Summary
RelationHandler __construct (String $nombreTabla, Array $parametros, [Bool $debug = false])
Integer createRelation (String $name, StructHandler $shObject, ElementHandler $ehObject, [Bool $debug = false])
Bool delete (String $relationName, [Bool $debug = false])
Bool exists (String $name)
Integer getId (String $relationName)
Array getRelation (String $name)
Methods
Constructor __construct (line 71)

The main constructor of the class

RelationHandler __construct (String $nombreTabla, Array $parametros, [Bool $debug = false])
  • String $nombreTabla: Name of the table (element table)
  • Array $parametros: Array of String with the characters to use.
  • Bool $debug: if true function will throw debug messages as USER_NOTICE
createRelation (line 124)

This function creates a relation between two elements.

  • return: ID of the relation if it has been created. -1 if not.
  • access: public
Integer createRelation (String $name, StructHandler $shObject, ElementHandler $ehObject, [Bool $debug = false])
  • String $name: String with the elements to connect
  • StructHandler $shObject: structHandler object
  • ElementHandler $ehObject: ElementHandler object
  • Bool $debug: if true function will throw debug messages as USER_NOTICE
delete (line 218)

Function that deletes the relation named $name.

  • return: true if it has been deleted. false if not.
  • access: public
Bool delete (String $relationName, [Bool $debug = false])
  • String $relationName
  • Bool $debug: if true function will throw debug messages as USER_NOTICE
exists (line 176)

Check if a relation exists on the table or not.

  • return: true if it exists. false if not.
  • access: public
Bool exists (String $name)
  • String $name: Name of the relation to check.
getId (line 197)

This function returns the id of a relation with a given name

  • return: ID of the relation if it exists. -1 if it doesn't exist.
  • access: public
Integer getId (String $relationName)
  • String $relationName
getRelation (line 249)

This function returns all the elements that match the regular expresion given by parameter.

  • return: Array of String with the results in format (TYPE1-ID1/TYPE2-ID2, TYPE1-ID3/TYPE4-ID4...)
  • access: public
Array getRelation (String $name)
  • String $name: regular expresion to match

Documentation generated by phpDocumentor 1.4.3
Modified by Sergio Barja for S2 - Hierarchical Data Model documentation.