Skip to content

Commit

Permalink
[7-7] InquiryRepositoryに未処理お問い合わせ一覧取得メソッドを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
hidenorigoto committed Dec 28, 2015
1 parent a79af42 commit afebc62
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/lists/ch07/07-07.txt
@@ -0,0 +1,13 @@
public function findUnprocessed()
{
$query = $this->createQueryBuilder('i')
->where('i.processStatus = :processStatus')
->orWhere('i.processStatus is null')
->orderBy('i.id', 'ASC')
->setParameters([
':processStatus' =>'0'
])
->getQuery();

return $query->execute();
}
14 changes: 14 additions & 0 deletions src/AppBundle/Entity/InquiryRepository.php
Expand Up @@ -26,4 +26,18 @@ public function findAllByKeyword($keyword)

return new ArrayCollection($query->getResult());
}

public function findUnprocessed()
{
$query = $this->createQueryBuilder('i')
->where('i.processStatus = :processStatus')
->orWhere('i.processStatus is null')
->orderBy('i.id', 'ASC')
->setParameters([
':processStatus' =>'0'
])
->getQuery();

return $query->execute();
}
}

0 comments on commit afebc62

Please sign in to comment.