Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad2ed73
commit 14b4446
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use Doctrine\Common\Collections\ArrayCollection; | ||
... | ||
class InquiryRepository extends \Doctrine\ORM\EntityRepository | ||
{ | ||
public function findAllByKeyword($keyword) | ||
{ | ||
$query = $this->createQueryBuilder('i') | ||
->where('i.name LIKE :keyword') | ||
->orWhere('i.tel LIKE :keyword') | ||
->orWhere('i.email LIKE :keyword') | ||
->orderBy('i.id', 'DESC') | ||
->setParameters([ | ||
':keyword' =>'%'.$keyword.'%' | ||
]) | ||
->getQuery(); | ||
|
||
return new ArrayCollection($query->getResult()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters