FormToSQL.php
[Pman.Builder] / FormToSQL.php
1 <?php
2
3 // quick way to build SQL based on a form design..
4 // might have uses later...
5
6 require_once 'Pman.php';
7
8 class Pman_Builder_FormToSQL extends Pman {
9     
10     function getAuth(){
11         if (!HTML_FlexyFramework::get()->cli) {
12             die("not cli");
13         }
14         return true;
15     }
16     
17     function get($file)
18     {
19         $ar = json_decode(file_get_contents($file));
20         $this->walk($o);
21         
22     }
23     
24     function walk($o) 
25     {
26         
27         $this->parse($o);
28         
29         
30         
31         
32         foreach($o as $k=>$v) {
33             if (is_array($v)) {
34                 foreach($v as $oo) {
35                     $this->walk($o);
36                 }
37                 
38                 continue;
39             }
40             if (is_object($v)) {
41                 $this->walk($v);
42                 continue;
43             }
44         }
45         
46     }
47     function parse($o) 
48     {
49         
50         if (empty($o->xtype)) {
51             return;
52         }
53         print_R($o);
54         
55     }
56     
57 }