This software is EXPERIMENTAL and not ready for production. It is just a proof of concept.
The application is intended to create:
- Doctrine1
- Doctrine2
- Propel
- Zend DbTable
- CakePHP
- ...
schema files from MySQL Workbench models (*.mwb). It is inspired by http://code.google.com/p/mysql-workbench-doctrine-plugin/.
Support for behaviours is implemented for Doctrine1. Use the comment fields in tables.
{d:actAs}
actAs:
timestampable:
[..]
{/d:actAs}
To replace relations name by the name of the foreign key, start the foreign key name with "d:".
- extendTableNameWithSchemaName
- {d:externalRelations}
- useAnnotationPrefix
- indentation
- useAutomaticRepository
- extendTableNameWithSchemaName
- bundleNamespace
- entityNamespace
- repositoryNamespace
- tablePrefix
- parentTable
- indentation
Works with PHP 5.3 and up.
- Doctrine Project
- MySQL Workbench
- Symfony Project
- MySQL Workbench Doctrine Plugin - google code project
<?php
// enable autoloading of classes
require_once('lib/MwbExporter/Core/SplClassLoader.php');
$classLoader = new SplClassLoader();
$classLoader->setIncludePath('lib');
$classLoader->register();
// define a formatter
$formatter = new \MwbExporter\Formatter\Doctrine2\Annotation\Loader();
// parse the mwb file
$mwb = new \MwbExporter\Core\Workbench\Document('myDatabaseModel.mwb', $formatter);
// show the output
echo $mwb->display();
// save as zip file in current directory and use .php as file endings
echo $mwb->zipExport(__DIR__, 'php');
?>