1: <?php class Domain {
2:
3:
4: private $tables = array();
5:
6: private $log = array();
7:
8: 9: 10: 11: 12:
13: private function __log($severity, $message) {
14: $this->log[] = array("severity"=>$severity, "message"=>$message);
15: }
16:
17: 18: 19: 20: 21:
22: public function getLog() {
23: return $this->log;
24: }
25:
26: 27: 28: 29: 30:
31: private function __makeLabel($name)
32: {
33: return ucwords(str_replace('_', ' ', $name));
34: }
35:
36: 37: 38:
39: private function __getFieldType($fieldType) {
40: $start = strpos($fieldType,'(');
41: if ($start > 0) {
42: $fieldType = substr($fieldType, 0, $start);
43: $this->__log("success", "fieldtype : $fieldType");
44: }
45: return $fieldType;
46: }
47:
48: 49: 50:
51: private function __getFieldLength($fieldType) {
52: $start = strpos($fieldType,'(')+1;
53: $len = null;
54: if ($start > 0) {
55: $count = strpos($fieldType,')')-$start;
56: $len = substr($fieldType, $start, $count);
57:
58: }
59: return $len;
60: }
61:
62: 63: 64:
65: private function __getFieldWidth($fieldType, $fieldLength) {
66: return 100;
67: }
68:
69: 70: 71:
72: private function __getFieldWidget($fieldType, $fieldLength) {
73: return "";
74: }
75:
76: }
77:
78: ?>
79: