public function findRandomBy(array $criteria, $limit)
    {
        $limit = intval($limit);
        if ($limit <= 1) {
            throw new \InvalidArgumentException('Please use `findRandomOneBy()` for single result.');
        }

        $queryBuilder = $this->getCollectionQueryBuilder();

        $this->applyCriteria($queryBuilder, $criteria);

        $query = $queryBuilder
            ->addSelect('RAND() as HIDDEN rand')
            ->orderBy('rand')
            ->setMaxResults($limit)
            ->getQuery()
        ;

        return $this->collectionResult($query);
    }