FEATURE: change directory structure
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace App\CMS\Handlers\Search;
|
||||
|
||||
use App\CMS\Handlers\Contracts\SearchHandler;
|
||||
use Symfony\Component\Process\Exception\InvalidArgumentException;
|
||||
|
||||
abstract class Search implements SearchHandler
|
||||
{
|
||||
/**
|
||||
* Tokenize string for usage in LIKE clausules
|
||||
*
|
||||
* @param $term
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function tokenize($term)
|
||||
{
|
||||
$term = trim($term);
|
||||
|
||||
if (empty($term)) {
|
||||
throw new InvalidArgumentException(trans('search.emptyString'));
|
||||
}
|
||||
|
||||
return '%' . str_replace(' ', '%', $term) . '%';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user