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
$percentage
EOSNIPPET; } }; ?> Emotion Hero

eye brows

"; foreach(EmotionHero\Models\Emotions::$EMOTIONS as $emotion) { echo "
$emotion
"; $printEmoBlocks($emotion, 'brows'); echo "getFeatureImgAsString("brows")}\" title=\"{$currentHit->getId()}\" style=\"top:{$currentHit->getEmotions()->getEmotionScore($emotion)}%\">"; echo "
"; } echo""; ?>