Skip to content

Commit

Permalink
Rename ThreadManagerInterface inbox and sent methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 26, 2011
1 parent daadd29 commit 6d04f2a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Controller/MessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MessageController extends ContainerAware
public function inboxAction()
{
$user = $this->getAuthenticatedParticipant();
$threads = $this->getThreadManager()->findUserInboxThreads($user);
$threads = $this->getThreadManager()->findParticipantInboxThreads($user);

return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:inbox.html.twig', array('threads' => $threads));
}
Expand All @@ -34,7 +34,7 @@ public function inboxAction()
public function sentAction()
{
$user = $this->getAuthenticatedParticipant();
$threads = $this->getThreadManager()->findUserSentThreads($user);
$threads = $this->getThreadManager()->findParticipantSentThreads($user);

return $this->container->get('templating')->renderResponse('OrnicarMessageBundle:Message:sent.html.twig', array('threads' => $threads));
}
Expand Down
12 changes: 6 additions & 6 deletions DocumentManager/ThreadManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function findThreadById($id)
* @param ParticipantInterface $user
* @return Builder a query builder suitable for pagination
*/
public function getUserInboxThreadsQueryBuilder(ParticipantInterface $user)
public function getParticipantInboxThreadsQueryBuilder(ParticipantInterface $user)
{
$isDeletedByParticipantFieldName = sprintf('isDeletedByParticipant.%s', $user->getId());
$datesOfLastMessageWrittenByOtherParticipantFieldName = sprintf('datesOfLastMessageWrittenByOtherParticipant.%s', $user->getId());
Expand All @@ -99,9 +99,9 @@ public function getUserInboxThreadsQueryBuilder(ParticipantInterface $user)
* @param ParticipantInterface $user
* @return array of ThreadInterface
*/
public function findUserInboxThreads(ParticipantInterface $user)
public function findParticipantInboxThreads(ParticipantInterface $user)
{
return $this->getUserInboxThreadsQueryBuilder($user)->getQuery()->execute();
return $this->getParticipantInboxThreadsQueryBuilder($user)->getQuery()->execute();
}

/**
Expand All @@ -113,7 +113,7 @@ public function findUserInboxThreads(ParticipantInterface $user)
* @param ParticipantInterface $user
* @return Builder a query builder suitable for pagination
*/
public function getUserSentThreadsQueryBuilder(ParticipantInterface $user)
public function getParticipantSentThreadsQueryBuilder(ParticipantInterface $user)
{
$datesOfLastMessageWrittenByParticipantFieldName = sprintf('datesOfLastMessageWrittenByParticipant.%s', $user->getId());
return $this->repository->createQueryBuilder()
Expand All @@ -131,9 +131,9 @@ public function getUserSentThreadsQueryBuilder(ParticipantInterface $user)
* @param ParticipantInterface $user
* @return array of ThreadInterface
*/
public function findUserSentThreads(ParticipantInterface $user)
public function findParticipantSentThreads(ParticipantInterface $user)
{
return $this->getUserSentThreadsQueryBuilder($user)->getQuery()->execute();
return $this->getParticipantSentThreadsQueryBuilder($user)->getQuery()->execute();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions ModelManager/ThreadManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function findThreadById($id);
* @param ParticipantInterface $user
* @return Builder a query builder suitable for pagination
*/
function getUserInboxThreadsQueryBuilder(ParticipantInterface $user);
function getParticipantInboxThreadsQueryBuilder(ParticipantInterface $user);

/**
* Finds not deleted threads for a user,
Expand All @@ -42,7 +42,7 @@ function getUserInboxThreadsQueryBuilder(ParticipantInterface $user);
* @param ParticipantInterface $user
* @return array of ThreadInterface
*/
function findUserInboxThreads(ParticipantInterface $user);
function findParticipantInboxThreads(ParticipantInterface $user);

/**
* Finds threads from a user,
Expand All @@ -53,7 +53,7 @@ function findUserInboxThreads(ParticipantInterface $user);
* @param ParticipantInterface $user
* @return Builder a query builder suitable for pagination
*/
function getUserSentThreadsQueryBuilder(ParticipantInterface $user);
function getParticipantSentThreadsQueryBuilder(ParticipantInterface $user);

/**
* Finds threads from a user,
Expand All @@ -64,7 +64,7 @@ function getUserSentThreadsQueryBuilder(ParticipantInterface $user);
* @param ParticipantInterface $user
* @return array of ThreadInterface
*/
function findUserSentThreads(ParticipantInterface $user);
function findParticipantSentThreads(ParticipantInterface $user);

/**
* Creates an empty comment thread instance
Expand Down

0 comments on commit 6d04f2a

Please sign in to comment.