name = $name; $this->set = $set; } public function buildQuery(QueryContext $context) { $name = FlagStructure::normalizeName($this->name); $flag = $context->getFlag($name); if (!$flag) { throw new QueryException(sprintf('Flag "%s" does not exist', $this->name)); } return [ 'term' => [ $flag->getIndexField() => $this->set ] ]; } public function getTermNodes() { return array(); } public function __toString() { return sprintf('', $this->name, $this->set ? 'set' : 'cleared'); } }