mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +00:00
35 lines
640 B
PHP
35 lines
640 B
PHP
<?php
|
|
|
|
namespace Alchemy\Phrasea\SearchEngine\Elastic\AST;
|
|
|
|
use Alchemy\Phrasea\SearchEngine\Elastic\Search\QueryContext;
|
|
|
|
class DatabaseExpression extends Node
|
|
{
|
|
private $database;
|
|
|
|
public function __construct($database)
|
|
{
|
|
$this->database = $database;
|
|
}
|
|
|
|
public function buildQuery(QueryContext $context)
|
|
{
|
|
return [
|
|
'term' => [
|
|
'databox_name' => $this->database
|
|
]
|
|
];
|
|
}
|
|
|
|
public function getTermNodes()
|
|
{
|
|
return array();
|
|
}
|
|
|
|
public function __toString()
|
|
{
|
|
return sprintf('<database:%s>', $this->database);
|
|
}
|
|
}
|