for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the MilioooMessageBundle package.
*
* (c) Michiel boeckaert <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Miliooo\Messaging\ThreadProvider\Folder;
use Miliooo\Messaging\Repository\ThreadRepositoryInterface;
use Miliooo\Messaging\User\ParticipantInterface;
/**
* Outbox provider for pagerfanta pagination
* @author Michiel Boeckaert <[email protected]>
class OutboxProviderPagerFanta extends AbstractProviderPagerFanta implements OutboxProviderPagerFantaInterface
{
* A thread repository instance.
* @var ThreadRepositoryInterface
protected $threadRepository;
* How many items we show per page
* @var integer
protected $itemsPerPage;
* @param ThreadRepositoryInterface $threadRepository A thread repository instance
* @param integer $itemsPerPage Total items per page
public function __construct(ThreadRepositoryInterface $threadRepository, $itemsPerPage)
$this->threadRepository = $threadRepository;
$this->itemsPerPage = $itemsPerPage;
}
* {@inheritdoc}
public function getOutboxThreadsPagerfanta(ParticipantInterface $participant, $currentPage)
$queryBuilder = $this->threadRepository->getOutboxThreadsForParticipantQueryBuilder($participant);
return $this->getPagerfantaObject($queryBuilder, $currentPage, $this->itemsPerPage);