Allow ExporterDrivers that implement the exportClassMetadata() function to return FALSE when no content is available/needs to be written to a file by the AbstractExporter, preventing empty files to be generated foreach processed ClassMetadataInfo instance.
This commit is contained in:
parent
06de4e62a5
commit
177adbdfc7
@ -111,7 +111,8 @@ abstract class AbstractExporter
|
||||
}
|
||||
|
||||
foreach ($this->_metadata as $metadata) {
|
||||
$output = $this->exportClassMetadata($metadata);
|
||||
//In case output is returned, write it to a file, skip otherwise
|
||||
if($output = $this->exportClassMetadata($metadata)){
|
||||
$path = $this->_generateOutputPath($metadata);
|
||||
$dir = dirname($path);
|
||||
if ( ! is_dir($dir)) {
|
||||
@ -123,6 +124,7 @@ abstract class AbstractExporter
|
||||
file_put_contents($path, $output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the path to write the class for the given ClassMetadataInfo instance
|
||||
|
Loading…
x
Reference in New Issue
Block a user