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
- 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:".
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();
?>