return true;
}
- function get()
+ function get($base, $opts = array())
{
//print_R($_SERVER['argv']);exit;
$file = $_SERVER['argv'][2];
array_pop($b);
$tn = strtolower(preg_replace('/([A-Z])/','_$1', array_pop($b)));
$tn = preg_replace('/^_+/', '', $tn);
- $this->toSQL($tn);
- $b= basename(dirname($file));
if (!empty($_SERVER['argv'][3])) {
- $b= $_SERVER['argv'][3];
+ $tn= $_SERVER['argv'][3];
}
+
+ $this->toSQL($tn);
+ $b= basename(dirname($file));
+
$do = $this->toDO($b, $tn);
- $dofile = dirname($file).'/DataObjects/'.ucfirst($b).'.php';
+ $dofile = dirname($file).'/DataObjects/'. ucfirst($tn).'.php';
if (!file_exists($dofile)) {
echo "WRITING $dofile\n";
file_put_contents($dofile, $do);
} else {
-
+ // should support AUTOCODE...
echo "DELETE $dofile IF YOU WANT TO RECREATED IT..\n";
- }
+ }
die("DONE");
}
$f->type = $type;
$f->size = $len;
$this->cols[] = $f;
- continue;
+ break;
}
// otherwise it's a datasource based one...
// our 18N fields are a bit odd here...
$f->size = 8;
$f->default = "''";
$this->cols[] = $f;
- continue;
+ break;
}
$f->name = isset($o->hiddenName) ? $o->hiddenName : $o->name;
$f->type = 'INT';
$f->extra = "NOT NULL";
$f->default = 0;
$this->cols[] = $f;
- continue;
+ break;
case 'TextArea':
$f->name = $o->name;
$f->type = 'TEXT';
$this->cols[] = $f;
- continue;
+ break;
case 'DateField':
case 'NumberField':
array_unshift($this->cols, $f);
break;
default:
- continue;
+ break;
}