Class ElementHandler

Description

The purpose of this class is to handle elements on our structure for being able to store nodes correctly.

Located in /elementHandlerClass.php (line 58)


	
			
Method Summary
ElementHandler __construct (String $nombreTabla, Array $parametros, [Bool $debug = false])
Bool delete ( $name,  $type, [Bool $debug = false])
Bool exists (String $name)
Integer getId (String $name, String $type)
String getNameId (Integer $elementid)
Array getNamesFromType (String $typename)
Integer insert (String $type, String $name, StructHandler $shObject, [Bool $debug = false])
Bool renameElement (Integer $elementId, String $newName, [Bool $debug = false])
Methods
Constructor __construct (line 72)

Constructor

ElementHandler __construct (String $nombreTabla, Array $parametros, [Bool $debug = false])
  • String $nombreTabla
  • Array $parametros
  • Bool $debug: if true function will throw debug messages as USER_NOTICE
delete (line 265)

Function that deletes the element named $name and type $type

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

This function checks if an element exists. It works with type-id.

(to search an element with name, use getId($name,$type)!=-1)

  • return: True if exists. false otherwise.
  • access: public
Bool exists (String $name)
  • String $name: element like TYPE-ID
getId (line 243)

This function returns the internal ID of an element with name and type.

  • return: ID of the element if it exists. -1 if there isn't an element with this name and type.
  • access: public
Integer getId (String $name, String $type)
  • String $name
  • String $type
getNameId (line 197)

This function returns the name of an element on the table.

  • return: String with the name of the element.
  • access: public
String getNameId (Integer $elementid)
  • Integer $elementid: internal ID of the element to return
getNamesFromType (line 176)

This function returns the names of the elements of a type like $typename

  • return: Array of String with the names of the elements with type $typename
  • access: public
Array getNamesFromType (String $typename)
  • String $typename
insert (line 108)

This function insert an element into the element table.

  • return: It returns the ID assigned to the element. -1 if it can not be inserted.
  • todo: check if there are another element with same name and type.
  • access: public
Integer insert (String $type, String $name, StructHandler $shObject, [Bool $debug = false])
  • String $type: type of the element to insert.
  • String $name: name of the element to insert.
  • StructHandler $shObject
  • Bool $debug: if true function will throw debug messages as USER_NOTICE
renameElement (line 296)

This function renames an element.

It checks if the new name is correct and doesn't exists another element with same type and same name.

  • return: true if it has been renamed.
  • access: public
Bool renameElement (Integer $elementId, String $newName, [Bool $debug = false])
  • Integer $elementId
  • String $newName
  • Bool $debug: if true function will throw debug messages as USER_NOTICE

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