Skip to content

Commit

Permalink
[DoctrineExtra] use new draw/graphviz library
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoiriert committed Oct 20, 2024
1 parent d321e89 commit b98857e
Show file tree
Hide file tree
Showing 10 changed files with 2,117 additions and 1,239 deletions.
18 changes: 17 additions & 1 deletion app/src/GraphGenerator/ContextPreparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
namespace App\GraphGenerator;

use App\Entity\User;
use Draw\Bundle\SonataImportBundle\Entity\Import;
use Draw\DoctrineExtra\ORM\GraphSchema\Event\PrepareContextEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;

class ContextPreparator
{
#[AsEventListener]
public function prepareImport(PrepareContextEvent $event): void
public function prepareUser(PrepareContextEvent $event): void
{
$context = $event->getContext();

Expand All @@ -22,4 +23,19 @@ public function prepareImport(PrepareContextEvent $event): void
->forEntityCluster(User::class)
;
}

#[AsEventListener]
public function prepareImport(PrepareContextEvent $event): void
{
$context = $event->getContext();

if ('import' !== $context->getName()) {
return;
}

$event->getContext()
->setIgnoreAll(true)
->forEntityCluster(Import::class)
;
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@
"generate:artifact": [
"Composer\\Config::disableProcessTimeout",
"bin/console draw:doctrine:generate-graph-schema | dot -Tsvg -o doc/database.svg",
"bin/console draw:doctrine:generate-graph-schema user | dot -Tsvg -o doc/user.svg"
"bin/console draw:doctrine:generate-graph-schema user | dot -Tsvg -o doc/user.svg",
"bin/console draw:doctrine:generate-graph-schema import | dot -Tsvg -o doc/import.svg"
]
},
"minimum-stability": "dev",
Expand Down
1,643 changes: 830 additions & 813 deletions doc/database.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 123 additions & 0 deletions doc/import.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b98857e

Please sign in to comment.