System = $System; $this->TypeDefinitionList = array ( 'Enumeration' => array('Name' => 'Enumeration', 'Class' => 'Enumeration', 'ParentType' => '', 'Parameters' => array()), 'Boolean' => array('Name' => 'Boolean', 'Class' => 'Boolean', 'ParentType' => '', 'Parameters' => array()), 'Integer' => array('Name' => 'Integer', 'Class' => 'Integer', 'ParentType' => '', 'Parameters' => array()), 'String' => array('Name' => 'String', 'Class' => 'String', 'ParentType' => '', 'Parameters' => array()), 'Text' => array('Name' => 'Text', 'Class' => 'Text', 'ParentType' => '', 'Parameters' => array()), 'Date' => array('Name' => 'Date', 'Class' => 'Date', 'ParentType' => '', 'Parameters' => array()), 'Time' => array('Name' => 'Time', 'Class' => 'Time', 'ParentType' => '', 'Parameters' => array()), 'DateTime' => array('Name' => 'DateTime', 'Class' => 'DateTime', 'ParentType' => '', 'Parameters' => array()), 'Password' => array('Name' => 'Password', 'Class' => 'Password', 'ParentType' => '', 'Parameters' => array()), 'Float' => array('Name' => 'Float', 'Class' => 'Float', 'ParentType' => '', 'Parameters' => array()), 'Hyperlink' => array('Name' => 'Hyperlink', 'Class' => 'Hyperlink', 'ParentType' => '', 'Parameters' => array()), 'Hidden' => array('Name' => 'Hidden', 'Class' => 'Hidden', 'ParentType' => '', 'Parameters' => array()), 'File' => array('Name' => 'File', 'Class' => 'File', 'ParentType' => '', 'Parameters' => array()), 'GPS' => array('Name' => 'GPS', 'Class' => 'GPS', 'ParentType' => '', 'Parameters' => array()), 'IPv4Address' => array('Name' => 'IPv4Address', 'Class' => 'IPv4Address', 'ParentType' => '', 'Parameters' => array()), 'PointerOneToOne' => array('Name' => 'PointerOneToOne', 'Class' => 'PointerOneToOne', 'ParentType' => '', 'Parameters' => array()), 'PointerOneToMany' => array('Name' => 'PointerOneToMany', 'Class' => 'PointerOneToMany', 'ParentType' => '', 'Parameters' => array()), ); } function ExecuteTypeEvent($TypeName, $Event, $Parameters = array()) { if(array_key_exists($TypeName, $this->TypeDefinitionList)) { $Type = $this->TypeDefinitionList[$TypeName]; $TypeClass = 'Type'.$Type['Class']; $TypeObject = new $TypeClass($this->System); if(is_callable(array($TypeObject, $Event))) return($TypeObject->$Event($Parameters)); else return($TypeName.'->'.$Event.'('.serialize($Parameters).')'); } else return($TypeName); } function RegisterType($Name, $ParentType, $Parameters) { if($ParentType != '') { $Type = $this->TypeDefinitionList[$ParentType]; } else $Type = array(); $Type['Name'] = $Name; $Type['Parameters'] = array_merge($Type['Parameters'], $Parameters); $this->TypeDefinitionList[$Name] = $Type; } function GetTypeDefinition($TypeName) { return($this->TypeDefinitionList[$TypeName]); } }