private function getDbConnection() {
$con = $this->_ar_manager->getDbConnection();
$con->Active = true;
return $con;
}
private function _getAllTableNames() {
$con = $this->getDbConnection();
$command = $con->createCommand("Show Tables");
$dataReader = $command->query();
$dataReader->bindColumn(1, $table);
$tables = array();
while ($dataReader->read()) {
$tables[] = $table;
}
$con->setActive(false);
return $tables;
}
private function _getClassName($tableName) {
return ucfirst($tableName);
}
public function renderAllTablesInformation() {
$conn = $this->_ar_manager->getDbConnection();
$gateway = $this->_ar_manager->getRecordGateway();
foreach ($this->_getAllTableNames() as $table_name) {
echo $table_name . "
";
$tableInfo = $gateway->getTableInfo($conn, $table_name);
echo "Table info:" . "
";
echo "";
var_dump($tableInfo);
echo "
";
}
}
//-----------------------------------------------------------------------------
protected function generateProperty($field, $column) {
$prop = '';
$name = '$' . $field;
/* TODO use in version 2.0 */
// $type = $column->getPHPType();
$prop .= "\tpublic $name;";
return $prop;
}
protected function generateClass($properties, $tablename, $class) {
$props = implode("\n", $properties);
$date = date('Y-m-d h:i:s');
return <<
EOD;
}
//
}
?>