<?php

namespace Project\AppBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * LessonRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class LessonRepository extends EntityRepository
{
    /**
     * Find the today lesson
     *
     * @return Lesson
     */
    public function findTodayLesson()
    {
        $em = $this->getEntityManager();

        return $em->createQuery(
                '
                SELECT l
                FROM ProjectAppBundle:Lesson l
                WHERE CURRENT_TIMESTAMP()  BETWEEN l.startDate AND l.endDate
                '
            )
            ->getOneOrNullResult();
    }

    /**
     * Find lessons terminated
     *
     * @return array
     */
    public function findEndedLessons()
    {
        $em = $this->getEntityManager();

        return $em->createQuery('
                SELECT l
                FROM ProjectAppBundle:Lesson l
                WHERE CURRENT_TIMESTAMP() > l.endDate
                ')
                ->getResult();
    }
}

<?php

namespace Project\AppBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * LessonRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class LessonRepository extends EntityRepository
{
    /**
     * Find the today lesson
     *
     * @return Lesson
     */
    public function findTodayLesson()
    {
        $em = $this->getEntityManager();

        return $em->createQuery(
                '
                SELECT l
                FROM ProjectAppBundle:Lesson l
                WHERE CURRENT_TIMESTAMP()  BETWEEN l.startDate AND l.endDate
                '
            )
            ->getOneOrNullResult();
    }

    /**
     * Find lessons terminated
     *
     * @return array
     */
    public function findEndedLessons()
    {
        $em = $this->getEntityManager();

        return $em->createQuery('
                SELECT l
                FROM ProjectAppBundle:Lesson l
                WHERE CURRENT_TIMESTAMP() > l.endDate
                ORDER BY l.startDate DESC
                ')
                ->getResult();
    }
}

Add order by start date
Add order by start date
