FEATURE: change directory structure

This commit is contained in:
Michal Kváček
2016-10-17 00:07:21 +02:00
parent 87f1920373
commit 2ded2924a1
242 changed files with 742 additions and 1171 deletions
+26
View File
@@ -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) . '%';
}
}