Knp\Bundle\KnpBundlesBundle\Repository\BundleRepository::findLatestTrend PHP Method

findLatestTrend() public method

public findLatestTrend ( $idlePeriod )
    public function findLatestTrend($idlePeriod)
    {
        return $this->createQueryBuilder('bundle')->where('bundle.score > 0')->andWhere('bundle.lastTweetedAt < :date or bundle.lastTweetedAt is null')->addOrderBy('bundle.trend1', 'desc')->setMaxResults(1)->setParameter('date', new \DateTime(sprintf('-%s day', $idlePeriod)))->getQuery()->getOneOrNullResult();
    }