class_mcPUIX_CONFIG.inc.php
2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
class mcPUIX_CONFIG {
//'KINDOF' => 'DATASET',
protected static $Tables = array();
public static function setTableConfig($param_tablename, array $param_TableValues) {
mcPUIX_CONFIG::$Tables[$param_tablename] = $param_TableValues;
}
/**
* return the table config
*
* @param string $param_tablename
* @param array $param_ManipulateTableConfig
* @return array( mcPUIX::PUIXArray => array( mcPUIX::DBUIConfig => array( $param_tablename => array()) ) ) || FALSE
*/
public static function getTableConfig($param_tablename, array $param_ManipulateTableConfig=null) {
if(array_key_exists($param_tablename, mcPUIX_CONFIG::$Tables) && is_array(mcPUIX_CONFIG::$Tables[$param_tablename])) {
$Config = mcPUIX_CONFIG::$Tables[$param_tablename];
if(is_array($param_ManipulateTableConfig)) {
if(!array_key_exists('TABLE', $Config) || !is_array($Config['TABLE'])) {
$Config['TABLE'] = array();
}
foreach($param_ManipulateTableConfig as $key => $value) {
$Config['TABLE'][$key] = $value;
}
}
$result = array(
mcPUIX::PUIXArray => array( mcPUIX::DBUIConfig => array( $param_tablename => $Config) )
);
return $result;
} else {
return false;
}
}
public static function getReferenceTableName($param_tablename) {
if(mcArray::checkKeyHasFullArray(mcPUIX_CONFIG::$Tables[$param_tablename], 'TABLE', mcPUIX::PUIX_SUB_REFERENCELIST)) {
if(mcPUIX_CONFIG::$Tables[$param_tablename]['TABLE'][mcPUIX::PUIX_SUB_REFERENCELIST]['TABLENAME']) {
$Tablename_LIST = mcPUIX_CONFIG::$Tables[$param_tablename]['TABLE'][mcPUIX::PUIX_SUB_REFERENCELIST]['TABLENAME'];
} else {
return false;
}
} else {
return false;
}
return $Tablename_LIST;
}
PUBLIC STATIC FUNCTION getReferenceListTableName($param_tablename) {
foreach(mcPUIX_CONFIG::$Tables as $tablename => $tableValues) {
if(mcArray::checkKeyHasFullArray($tableValues, 'TABLE', mcPUIX::PUIX_SUB_REFERENCELIST)
&& $tableValues['TABLE'][mcPUIX::PUIX_SUB_REFERENCELIST]['TABLENAME']
&& $tableValues['TABLE'][mcPUIX::PUIX_SUB_REFERENCELIST]['TABLENAME'] === $param_tablename
) {
return $tableValues['TABLE']['TABLENAME'];
}
}
}
}
?>