Skip to content

Commit 49b9b55

Browse files
committed
✨ write to output
1 parent a8ca038 commit 49b9b55

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/Exporter.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
use Doctrine\ORM\EntityManager;
66
use Doctrine\ORM\EntityManagerInterface;
77
use PDO;
8+
use Symfony\Component\Console\Output\OutputInterface;
89
use Tapestry\Entities\Collections\FlatCollection;
910
use Tapestry\Entities\Project;
1011
use Doctrine\DBAL\Connection;
1112
use Tapestry\Modules\ContentTypes\ContentTypeFactory;
13+
use Tapestry\Tapestry;
1214
use TapestryCloud\Database\Entities\ContentType;
1315
use TapestryCloud\Database\Entities\Environment;
1416
use TapestryCloud\Database\Entities\File;
@@ -21,18 +23,27 @@ class Exporter {
2123
* @var EntityManagerInterface|EntityManager
2224
*/
2325
private $entityManager;
26+
/**
27+
* @var OutputInterface
28+
*/
29+
private $output;
2430

2531
/**
2632
* Exporter constructor.
2733
* @param EntityManagerInterface $entityManager
28-
* @throws \Exception
34+
* @param Tapestry $tapestry
2935
*/
30-
public function __construct(EntityManagerInterface $entityManager)
36+
public function __construct(EntityManagerInterface $entityManager, Tapestry $tapestry)
3137
{
3238
$this->entityManager = $entityManager;
39+
$this->output = $tapestry->getContainer()->get(OutputInterface::class);
40+
3341
}
3442

3543
public function export(Project $project) {
44+
45+
$this->output->writeln('[$] Syncing with database.');
46+
3647
/** @var FlatCollection $files */
3748
$files = $project->get('files');
3849

0 commit comments

Comments
 (0)