mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
28 lines
482 B
PHP
28 lines
482 B
PHP
<?php
|
|
|
|
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
|
|
|
class PrefixNode extends Node
|
|
{
|
|
protected $prefix;
|
|
|
|
public function __construct($prefix)
|
|
{
|
|
$this->prefix = $prefix;
|
|
}
|
|
|
|
public function getQuery($field = '_all')
|
|
{
|
|
return array(
|
|
'prefix' => array(
|
|
$field => $this->prefix
|
|
)
|
|
);
|
|
}
|
|
|
|
public function __toString()
|
|
{
|
|
return sprintf('prefix("%s")', $this->prefix);
|
|
}
|
|
}
|