Skip to content

Instantly share code, notes, and snippets.

@flyx
Created February 17, 2012 17:44
Show Gist options
  • Save flyx/1854562 to your computer and use it in GitHub Desktop.
Save flyx/1854562 to your computer and use it in GitHub Desktop.
<?php
/**
* concerts
*/
class Concert extends ORMBase {
/**
* INT(10)
*/
var $id = 5;
/**
* TEXT UNICODE
*/
var $name = 'derp';
public function __construct($row = NULL) {
parent::__construct($row);
}
}
// ...
$class = new Concert();
echo $class->generateTableCreation();
// CREATE TABLE `concerts` (`id` INT(10) auto_increment,
//`name` TEXT UNICODE,
// PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment