public function generate($taskName, $time = null)
{
$template = $this->createClassTemplate($taskName, $time);
$template->addMethod('public', 'upgrade', array(), '');
$template->addMethod('public', 'downgrade', array(), '');
$filename = $this->generateFilename($taskName, $time);
$path = $this->migrationDir . DIRECTORY_SEPARATOR . $filename;
if (false === file_put_contents($path, $template->render())) {
throw new RuntimeException("Can't write template to {$path}");
}
return array($template->class->name, $path);
}