getRepository(Card::class)->findOneBy([], ['id' => 'DESC']); echo "
"; $c && var_dump( array_map(fn ($item) => [$item->key, $item->value], $c->meta->toArray()), array_map(fn ($item) => " Votes: " . $item->getVotesTotal(), $c->artworks->toArray()), array_map(fn ($item) => $item->value, $c->votes->toArray()), 'Votes: ' . $c->getVotesTotal(), ); return Template::render('home.twig', [ 'fields' => [ 'name' => 'meta[name]', 'converted mana cost' => 'meta[cmc]', 'is uno reverse' => 'meta[is_uno_reverse]', ], ]); } public static function dashboard() { $cards = DB::$entityManager->getRepository(Card::class)->findAll(); $cardOfTheDay = $cards[array_rand($cards)]; return Template::render('dashboard.twig', [ 'cardOfTheDay' => $cardOfTheDay, ]); } }