src/Entity/Hydrator/EntityHydrator.php
public function setExcludeMethods($methods)
    {
        if (is_string($methods)) {
            $methods = array($methods);
        }
        foreach ($methods as $method) {
            $this->addFilter($method, new MethodMatchFilter($method), FilterComposite::CONDITION_AND);
        }
    }
public function setExcludeMethods($methods)
    {
        if (is_string($methods)) {
            $methods = array($methods);
        }
        foreach ($methods as $method) {
            $this->addFilter($method, new MethodMatchFilter($method), FilterComposite::CONDITION_AND);
        }
    }
exclude methods from the automatism

@param $methods