-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented contains,starts/ends_with in searchCallbacks instead of i… (
#53) * Implemented contains,starts/ends_with in searchCallbacks instead of in getSpecialOperators() * Apply fixes from StyleCI * Pipeline fix * Small fix * Apply fixes from StyleCI --------- Co-authored-by: David <david.katalinic@asseco-see.hr> Co-authored-by: StyleCI Bot <bot@styleci.io>
- Loading branch information
1 parent
531b333
commit fd8f5c3
Showing
6 changed files
with
157 additions
and
1 deletion.
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
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
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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Asseco\JsonQueryBuilder\SearchCallbacks; | ||
|
||
use Asseco\JsonQueryBuilder\CategorizedValues; | ||
use Exception; | ||
use Illuminate\Database\Eloquent\Builder; | ||
|
||
class Contains extends AbstractCallback | ||
{ | ||
public static function operator(): string | ||
{ | ||
return 'contains'; | ||
} | ||
|
||
/** | ||
* @param Builder $builder | ||
* @param string $column | ||
* @param CategorizedValues $values | ||
* @return void | ||
* | ||
* @throws Exception | ||
*/ | ||
public function execute(Builder $builder, string $column, CategorizedValues $values): void | ||
{ | ||
$this->containsCallback($builder, $column, $values, 'contains'); | ||
} | ||
} |
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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Asseco\JsonQueryBuilder\SearchCallbacks; | ||
|
||
use Asseco\JsonQueryBuilder\CategorizedValues; | ||
use Exception; | ||
use Illuminate\Database\Eloquent\Builder; | ||
|
||
class EndsWith extends AbstractCallback | ||
{ | ||
public static function operator(): string | ||
{ | ||
return 'ends_with'; | ||
} | ||
|
||
/** | ||
* @param Builder $builder | ||
* @param string $column | ||
* @param CategorizedValues $values | ||
* @return void | ||
* | ||
* @throws Exception | ||
*/ | ||
public function execute(Builder $builder, string $column, CategorizedValues $values): void | ||
{ | ||
$this->endsWithCallback($builder, $column, $values, 'ends_with'); | ||
} | ||
} |
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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Asseco\JsonQueryBuilder\SearchCallbacks; | ||
|
||
use Asseco\JsonQueryBuilder\CategorizedValues; | ||
use Exception; | ||
use Illuminate\Database\Eloquent\Builder; | ||
|
||
class StartsWith extends AbstractCallback | ||
{ | ||
public static function operator(): string | ||
{ | ||
return 'starts_with'; | ||
} | ||
|
||
/** | ||
* @param Builder $builder | ||
* @param string $column | ||
* @param CategorizedValues $values | ||
* @return void | ||
* | ||
* @throws Exception | ||
*/ | ||
public function execute(Builder $builder, string $column, CategorizedValues $values): void | ||
{ | ||
$this->startsWithCallback($builder, $column, $values, 'starts_with'); | ||
} | ||
} |
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