FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

add multi like ci operator for elasticsearch 8 by UrosPurtic · Pull Request #66 · g4code/data-mapper · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .php  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or 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,31 @@
<?php

namespace G4\DataMapper\Engine\Elasticsearch\Version8\Operators;

use G4\DataMapper\Common\QueryOperatorInterface;
use G4\DataMapper\Common\SingleValue;
use G4\DataMapper\Engine\Elasticsearch\Operators\LikeCIOperator;

/**
* Class MultiLikeCIOperator
*
* @package G4\DataMapper\Engine\Elasticsearch\Operators
*/
class MultiLikeCIOperator extends LikeCIOperator implements QueryOperatorInterface
{

public function __construct($name, SingleValue $value)
{
parent::__construct($name, $this->formatValue($value));
}

public function format()
{
return parent::format(); // TODO: Change the autogenerated stub
}

private function formatValue(SingleValue $value)
{
return new SingleValue(str_replace([" ","-"], "* AND *", $value));
}
}

Back | FazBrowse Home | New Git URL