public function findOneBySlug($slug)
    {
        $query = $this->createQueryBuilder('c')
            ->where('c.slug = :slug')
            ->setParameter('slug', $slug)
            ->andWhere('c.publishAt < :now OR c.publishAt IS NULL')
            ->andWhere('c.active = :active')
            ->andWhere('c.layout = :layout')
            ->setParameter('now', new \DateTime())
            ->setParameter('active', true)
            ->setParameter('layout', false)
            ->setMaxResults(1)
            ->getQuery();

        return $query->useResultCache(true, self::CACHE_TTL)->getOneOrNullResult();
    }