getEm(); /* @var $hitRepo EmotionHero\Models\HitRepository */ $hitRepo = $em->getRepository(\EmotionHero\Models\Hit::class); /* @var $currentHit \EmotionHero\Models\Hit */ $currentHit = $hitRepo->findOneBy(['hasImage'=>true], ['id'=>'DESC']); $printEmoBlocks = function($emotion, $feature, $steps = 6) use($em) { $hits = $em->getRepository(EmotionHero\Models\Hit::class)->findBy(['hasImage'=>true],["emotions.$emotion" => 'ASC']); foreach($hits as $hit) { /* @var $hit EmotionHero\Models\Hit */ $img = $hit->getFeatureImgAsString($feature); $score = $hit->getEmotions()->getEmotionScore($emotion); $percentage = sprintf("%.7f %%",$score); echo <<< EOSNIPPET