Skip to content

Instantly share code, notes, and snippets.

@kdambekalns
Created August 29, 2012 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdambekalns/3508881 to your computer and use it in GitHub Desktop.
Save kdambekalns/3508881 to your computer and use it in GitHub Desktop.
Add --dump-mapping-data to doctrine:entitystatus
diff --git a/Classes/Command/DoctrineCommandController.php b/Classes/Command/DoctrineCommandController.php
index 9ce9c72..7b2e599 100644
--- a/Classes/Command/DoctrineCommandController.php
+++ b/Classes/Command/DoctrineCommandController.php
@@ -132,13 +132,15 @@ class DoctrineCommandController extends \TYPO3\FLOW3\MVC\Controller\CommandContr
* Show the current status of entities and mappings
*
* Shows basic information about which entities exist and possibly if their
- * mapping information contains errors or not. To run a full validation, use
- * the validate command.
+ * mapping information contains errors or not.
*
+ * To run a full validation, use the validate command.
+ *
+ * @param boolean $dumpMappingData If set, the mapping data will be output
* @return void
* @see typo3.flow3:doctrine:validate
*/
- public function entityStatusCommand() {
+ public function entityStatusCommand($dumpMappingData = FALSE) {
$info = $this->doctrineService->getEntityStatus();
if ($info === array()) {
@@ -147,8 +149,12 @@ class DoctrineCommandController extends \TYPO3\FLOW3\MVC\Controller\CommandContr
} else {
$this->outputLine('Found %d mapped entities:', array(count($info)));
foreach ($info as $entityClassName => $entityStatus) {
- if ($entityStatus === TRUE) {
+ if ($entityStatus instanceof \Doctrine\Common\Persistence\Mapping\ClassMetadata) {
$this->outputLine('[OK] %s', array($entityClassName));
+ if ($dumpMappingData) {
+ \TYPO3\FLOW3\Error\Debugger::clearState();
+ $this->outputLine(\TYPO3\FLOW3\Error\Debugger::renderDump($entityStatus, 0, TRUE, TRUE));
+ }
} else {
$this->outputLine('[FAIL] %s', array($entityClassName));
$this->outputLine($entityStatus);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment