<?php

namespace Stfalcon\Bundle\SponsorBundle\Repository;

use Doctrine\ORM\EntityRepository;
use Stfalcon\Bundle\EventBundle\Entity\Event as Event;

/**
 * SponsorRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class SponsorRepository extends EntityRepository
{
    /**
     * Get all sponsors of event
     *
     * @param Event $event
     *
     * @return array List of sponsors
     */
    public function getSponsorsOfEvent(Event $event)
    {
        return $this->getEntityManager()
            ->createQuery('
                SELECT s
                FROM StfalconSponsorBundle:Sponsor s
                JOIN s.events e
                WHERE e.id = :eventId
                ORDER BY s.name ASC
            ')
            ->setParameter('eventId', $event->getId())
            ->getResult();
    }
}

<?php

namespace Stfalcon\Bundle\SponsorBundle\Repository;

use Doctrine\ORM\EntityRepository;
use Stfalcon\Bundle\EventBundle\Entity\Event as Event;

/**
 * SponsorRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class SponsorRepository extends EntityRepository
{
    /**
     * Get all sponsors of event
     *
     * @param Event $event
     *
     * @return array List of sponsors
     */
    public function getSponsorsOfEvent(Event $event)
    {
        return $this->getEntityManager()
            ->createQuery('
                SELECT s
                FROM StfalconSponsorBundle:Sponsor s
                JOIN s.events e
                WHERE e.id = :eventId
                ORDER BY s.sortOrder DESC, s.name ASC
            ')
            ->setParameter('eventId', $event->getId())
            ->getResult();
    }
}

Update sorting sponsors by orderSort
Update sorting sponsors by orderSort
