1
0
mirror of https://github.com/ToxicCrack/PrintABrick.git synced 2025-05-28 01:30:11 -07:00

Disable SQLLogger

This commit is contained in:
Unknown 2017-06-08 19:28:38 +02:00
parent ac051df6a2
commit 69aaca9740
3 changed files with 5 additions and 2 deletions

View File

@ -52,6 +52,7 @@ abstract class BaseLoader
$this->em = $em;
$this->logger = $logger;
$this->formatTransformer = new FormatTransformer();
$this->em->getConnection()->getConfiguration()->setSQLLogger(null);
}
public function setOutput(OutputInterface $output)

View File

@ -164,7 +164,6 @@ class ModelLoader extends BaseLoader
$index = 0;
$connection = $this->em->getConnection();
$connection->getConfiguration()->setSQLLogger(null);
foreach ($files as $file) {
$this->progressBar->setMessage($file['basename']);

View File

@ -77,16 +77,19 @@ class RelationLoader extends BaseLoader
private function loadPartRelation(Part $part)
{
$number = $part->getId();
// Find model by id or alias
$model = $this->modelRepository->findOneByNumber($number);
if (!$model) {
// Try to find relation from part_model.yml file
$number = $this->relationMapper->find($this->getPrintedParentId($number), 'part_model');
// Find model by id or alias
$model = $this->modelRepository->findOneByNumber($number);
if (!$model) {
// If model not found, try to find by identical model name
$model = $this->modelRepository->findOneByName($part->getName());
}
}
return $model;
}