Merge commit 'upstream/master'
This commit is contained in:
commit
09fbd8f190
@ -134,16 +134,16 @@ EOT
|
|||||||
}
|
}
|
||||||
|
|
||||||
$converter = new ConvertDoctrine1Schema($fromPaths);
|
$converter = new ConvertDoctrine1Schema($fromPaths);
|
||||||
$metadatas = $converter->getMetadatas();
|
$metadata = $converter->getMetadata();
|
||||||
|
|
||||||
if ($metadatas) {
|
if ($metadatas) {
|
||||||
$output->write(PHP_EOL);
|
$output->write(PHP_EOL);
|
||||||
|
|
||||||
foreach ($metadatas as $metadata) {
|
foreach ($metadata as $class) {
|
||||||
$output->write(sprintf('Processing entity "<info>%s</info>"', $metadata->name) . PHP_EOL);
|
$output->write(sprintf('Processing entity "<info>%s</info>"', $class->name) . PHP_EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
$exporter->setMetadatas($metadatas);
|
$exporter->setMetadata($metadata);
|
||||||
$exporter->export();
|
$exporter->export();
|
||||||
|
|
||||||
$output->write(PHP_EOL . sprintf(
|
$output->write(PHP_EOL . sprintf(
|
||||||
|
@ -97,8 +97,8 @@ EOT
|
|||||||
}
|
}
|
||||||
|
|
||||||
$cmf = new DisconnectedClassMetadataFactory($em);
|
$cmf = new DisconnectedClassMetadataFactory($em);
|
||||||
$metadatas = $cmf->getAllMetadata();
|
$metadata = $cmf->getAllMetadata();
|
||||||
$metadatas = MetadataFilter::filter($metadatas, $input->getOption('filter'));
|
$metadata = MetadataFilter::filter($metadata, $input->getOption('filter'));
|
||||||
|
|
||||||
// Process destination directory
|
// Process destination directory
|
||||||
if ( ! is_dir($destPath = $input->getArgument('dest-path'))) {
|
if ( ! is_dir($destPath = $input->getArgument('dest-path'))) {
|
||||||
@ -132,12 +132,12 @@ EOT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($metadatas)) {
|
if (count($metadata)) {
|
||||||
foreach ($metadatas as $metadata) {
|
foreach ($metadata as $class) {
|
||||||
$output->write(sprintf('Processing entity "<info>%s</info>"', $metadata->name) . PHP_EOL);
|
$output->write(sprintf('Processing entity "<info>%s</info>"', $class->name) . PHP_EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
$exporter->setMetadatas($metadatas);
|
$exporter->setMetadata($metadata);
|
||||||
$exporter->export();
|
$exporter->export();
|
||||||
|
|
||||||
$output->write(PHP_EOL . sprintf(
|
$output->write(PHP_EOL . sprintf(
|
||||||
|
@ -41,7 +41,8 @@ class ConvertDoctrine1Schema
|
|||||||
private $_legacyTypeMap = array(
|
private $_legacyTypeMap = array(
|
||||||
// TODO: This list may need to be updated
|
// TODO: This list may need to be updated
|
||||||
'clob' => 'text',
|
'clob' => 'text',
|
||||||
'timestamp' => 'datetime'
|
'timestamp' => 'datetime',
|
||||||
|
'enum' => 'string'
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -238,6 +239,7 @@ class ConvertDoctrine1Schema
|
|||||||
if (isset($relation['refClass'])) {
|
if (isset($relation['refClass'])) {
|
||||||
$type = 'many';
|
$type = 'many';
|
||||||
$foreignType = 'many';
|
$foreignType = 'many';
|
||||||
|
$joinColumns = array();
|
||||||
} else {
|
} else {
|
||||||
$type = isset($relation['type']) ? $relation['type'] : 'one';
|
$type = isset($relation['type']) ? $relation['type'] : 'one';
|
||||||
$foreignType = isset($relation['foreignType']) ? $relation['foreignType'] : 'many';
|
$foreignType = isset($relation['foreignType']) ? $relation['foreignType'] : 'many';
|
||||||
|
@ -76,6 +76,8 @@ class <className> extends EntityRepository
|
|||||||
mkdir($dir, 0777, true);
|
mkdir($dir, 0777, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
file_put_contents($path, $code);
|
if ( ! file_exists($path)) {
|
||||||
|
file_put_contents($path, $code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,8 +2,12 @@
|
|||||||
|
|
||||||
namespace Doctrine\ORM\Tools;
|
namespace Doctrine\ORM\Tools;
|
||||||
|
|
||||||
class ToolsException extends ORMException {
|
use Doctrine\ORM\ORMException;
|
||||||
public static function couldNotMapDoctrine1Type($type) {
|
|
||||||
|
class ToolsException extends ORMException
|
||||||
|
{
|
||||||
|
public static function couldNotMapDoctrine1Type($type)
|
||||||
|
{
|
||||||
return new self("Could not map doctrine 1 type '$type'!");
|
return new self("Could not map doctrine 1 type '$type'!");
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user