diff --git a/hello.css b/hello.css index ab4f7902913f1c759029fbebe8a1e3c8462719e8..c3d4f4fb05fad3f779717d76db26beee8fbc6aaf 100644 --- a/hello.css +++ b/hello.css @@ -68,8 +68,8 @@ code { } #gregoire img, #maxime img { - width: 150px; - height: 150px; + width: 200px; + height: 200px; } #hello { @@ -115,10 +115,14 @@ code { } .big_code pre code { - font-size: 1.8em; + font-size: 1.7em; line-height: 1.3; } +.reveal table { + font-size: 0.9em; +} + @media screen and (max-width: 1280px) { .reveal h1 { font-size: 3em; @@ -157,6 +161,11 @@ code { font-size: 0.7em; } + #gregoire img, #maxime img { + width: 150px; + height: 150px; + } + .big_code pre { width: 90%; diff --git a/index.md b/index.md index d88a6fe40376216c809c7341b87dcf67a81a956d..506ded2e1784a0c66c59b61f6510751117cbb967 100644 --- a/index.md +++ b/index.md @@ -452,20 +452,22 @@ Quand les repositories ne respectent pas l'ISP ```php final class DoctrineGetLatestArticles implements GetLatestArticlesInterface { - public function __construct(EntityManagerInterface $entityManager) + private $registry; + public function __construct(RegistryInterface $registry) { - $this->entityManager = $entityManager; + $this->registry = $registry; } public function __invoke(int $size): iterable { - $this->entityManager->createQueryBuilder() - ->select('a.*') - ->from(Article::class) - ->orderBy('a.createdAt', 'DESC') - ->setMaxResults($size) - ->getQuery() - ->getResults(); + return $this->registry->getManager()->createQueryBuilder() + ->select('a') + ->from(Article::class, 'a') + ->orderBy('a.id', 'DESC') + ->setMaxResults($size) + ->getQuery() + ->execute() + ; } } ``` @@ -548,12 +550,12 @@ Note: Récupérer tous les articles dont les commentaires contiennent Doctrine **sans les commentaires**. ```php $queryBuilder - ->select('a.*') - ->from(Article::class) - ->innerJoin(Comment::class, 'c', Expr\Join::WITH, 'c.article_id = a.id') - ->where("c.content LIKE '%Doctrine%'") - ->getQuery() - ->getResults(); + ->select('a') + ->from(Article::class, 'a') + ->innerJoin(Comment::class, 'c', Expr\Join::WITH, 'c.article_id = a.id') + ->where("c.content LIKE '%Doctrine%'") + ->getQuery() + ->getResults(); ``` <video data-autoplay height="400" src="./UntidyCraftyCanadagoose.webm"> @@ -619,23 +621,22 @@ Note: ```php $rsm = new ResultSetMappingBuilder($entityManager); - $rsm->addRootEntityFromClassMetadata(Comment::class, 'c'); $rsm->addJoinedEntityFromClassMetadata( - Article::class, - 'a', - 'c', - 'article', - ['uuid' => 'article_uuid'] + Article::class, + 'a', + 'c', + 'article', + ['id' => 'article_id', 'content' => 'article_content'] ); $query = $entityManager->createNativeQuery( <<<'SQL' - SELECT *, a.uuid AS article_uuid, c.uuid AS comment_uuid + SELECT c.*, a.title AS title, a.content AS article_content, a.id AS article_id FROM comment c - INNER JOIN article ON c.article_uuid = a.uuid - WHERE article_uuid = ? + INNER JOIN article a ON c.article_id = a.id + WHERE article_id = ? SQL , $rsm); $query->setParameter(1, $article->getUuid()); diff --git a/reveal.json b/reveal.json index 5de2cd576f6ceb31afd80b22f7da8fc87060ea77..2cec933f8cd28d2286fb767b2643f1d45152d09a 100644 --- a/reveal.json +++ b/reveal.json @@ -1,4 +1,8 @@ { "width": "100%", - "height": "100%" - } \ No newline at end of file + "height": "100%", + "keyboard": { + "38": "next", + "40": "prev" + } + }