Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set Query::HINT? #316

Open
megusta420 opened this issue Mar 10, 2022 · 2 comments
Open

How to set Query::HINT? #316

megusta420 opened this issue Mar 10, 2022 · 2 comments
Assignees
Labels

Comments

@megusta420
Copy link

Is there a documented way to do this or should I override getQuery() method?

@peter-gribanov
Copy link
Member

You need to use ResultModifier

final class Hint implements ResultModifier
{
    private string $hint;

    public function __construct(string $hint)
    {
        $this->hint = $hint;
    }

    public function modify(AbstractQuery $query): void
    {
        $query->setHint($this->hint, true);
    }
}

@peter-gribanov peter-gribanov self-assigned this Mar 11, 2022
@megusta420
Copy link
Author

@peter-gribanov sorry, my fault, didn't take attention to this doc section. Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants