Bundle/CoreBundle/Repository/ViewRepository.php
public function getAll($excludeUnpublished = false)
    {
        $this->qb = $this->getInstance();

        //If $excludeUnpublished === true, we exclude the non published results
        if ($excludeUnpublished) {
            $this->qb
                ->andWhere($this->mainAlias.'.status = :status')
                ->orWhere($this->mainAlias.'.status = :scheduled_status AND '.$this->mainAlias.'.publishedAt > :publicationDate')
                ->setParameter('status', PageStatus::PUBLISHED)
                ->setParameter('scheduled_status', PageStatus::SCHEDULED)
                ->setParameter('publicationDate', new \DateTime());
        }

        return $this;
    }
public function getAll($excludeUnpublished = false)
    {
        $this->qb = $this->getInstance();

        //If $excludeUnpublished === true, we exclude the non published results
        if ($excludeUnpublished) {
            $this->qb
                ->andWhere($this->mainAlias.'.status = :status')
                ->orWhere($this->mainAlias.'.status = :scheduled_status AND '.$this->mainAlias.'.publishedAt > :publicationDate')
                ->setParameter('status', PageStatus::PUBLISHED)
                ->setParameter('scheduled_status', PageStatus::SCHEDULED)
                ->setParameter('publicationDate', new \DateTime());
        }

        return $this;
    }
public function getAll ( $ excludeUnpublished = false ) { $ this -> qb = $ this -> getInstance ( ) ; //If $excludeUnpublished === true, we exclude the non published results if ( $ excludeUnpublished ) { $ this -> qb -> andWhere ( $ this -> mainAlias . '.status = :status' ) -> orWhere ( $ this -> mainAlias . '.status = :scheduled_status AND ' . $ this -> mainAlias . '.publishedAt > :publicationDate' ) -> setParameter ( 'status' , PageStatus :: PUBLISHED ) -> setParameter ( 'scheduled_status' , PageStatus :: SCHEDULED ) -> setParameter ( 'publicationDate' , new \ DateTime ( ) ) ; } return $ this ; }
Get all rentals in the repository.

@param bool $excludeUnpublished Should we get only the published Views ?

@return ViewRepository
Get all rentals in the repository .