Gets hydrator from HydratorManager

@param string|null $hydrator
@return HydratorInterface
423258
public function getHydrator($hydrator = null)
    {
        $hydrator           = $hydrator ?? $this->hydrator ?? $this->serviceAlias;
        $sl                 = $this->getServiceLocator();
        $hydratorManager    = $sl->get('HydratorManager');
        $hydrator           = $hydratorManager->get($hydrator);

        return $hydrator;
    }
553688
public function hydrate($value, $data = [])
    {
        if (is_array($value)) {
            $coll = new ArrayCollection();
            foreach ($value as $v) {
                $coll->add($this->hydrate($v, $data));
            }
            return $coll;
        }

        if (empty($value) || 0 !== strpos($value, '{')) {
            return null;
        }

        $location = $this->getLocationEntity();
        return $location->fromString($value);
    }
854226
public static function hydrate(stdClass $taint)
    {
        $hydrated = new TaintEntity();

        if (isset($taint->id)) {
            $hydrated->setId($taint->id);
        }

        if (isset($taint->start_line)) {
            $hydrated->setStartLine($taint->start_line);
        }

        if (isset($taint->end_line)) {
            $hydrated->setEndLine($taint->end_line);
        }

        if (isset($taint->start_column)) {
            $hydrated->setStartColumn($taint->start_column);
        }

        if (isset($taint->end_column)) {
            $hydrated->setEndColumn($taint->end_column);
        }

        return $hydrated;
    }
334553
public function load(string $class): HydratorInterface
    {
        if (isset($this->hydrators[$class])) {
            return $this->hydrators[$class];
        }

        /** @var ClassMetadata $classMetadata */
        $classMetadata = $this->metadataFactory->getMetadataForClass($class);

        if (null === $classMetadata) {
            throw new \RuntimeException(
                'No mapping file was found for class '.$class.
                '. Did you configure the correct paths for serializer?'
            );
        }

        $fqn = $this->configuration->getFQNClassName($classMetadata);

        if (\class_exists($fqn, false)) {
            return $this->hydrators[$class] = $this->factory->newInstance($classMetadata);
        }

        $this->compileAndLoad($classMetadata);

        return $this->hydrators[$class] = $this->factory->newInstance($classMetadata);
    }
1049733
public function get($sClass)
    {
        if($this->sentryContainer != null && $this->sentryContainer->has($sClass))
        {
            return $this->sentryContainer->get($sClass);
        }
        return $this->coreContainer[$sClass];
    }
439941
protected function hydrator(): Hydrates
    {
        if (isset($this->decisionKey)) {
            return $this->choiceHydrator();
        }
        $mapped = Mapper::forThe($this->class);
        foreach ($this->properties as $property => $instruction) {
            $mapped = $mapped->property($property, $instruction);
        }
        return $mapped->finish();
    }
256792
protected function setResult($hydratorset = null, $callback = null) {

        $res = $this->builder->getQuery()->execute();
        $call = "Searcher\\Searcher\\Hydrators\\" . ucfirst($hydratorset) . "Hydrator";

        if ($res->valid() === true) {

            if(class_exists($call) === true) {

                $res = (new $call($res))->extract($callback);

            }
            return $res;
        }
        return null;

    }
1108614
protected function buildDoctrineObjectHydratorPrototype($hydratorName)
    {
        if (!class_exists($hydratorName)) {
            $this->prototype[$hydratorName] = false;
            return false;
        }

        if (!$this->isValidDoctrineObjectHydratorClass($hydratorName)) {
            $this->prototype[$hydratorName] = false;
            return false;
        }

        $objectManagerAutoDetector = $this->getObjectManagerAutoDetector();
        if (false === $objectManagerAutoDetector->hasObjectManagerNameByClassName($hydratorName)) {
            $this->prototype[$hydratorName] = false;
            return false;
        }

        $objectManagerName = $objectManagerAutoDetector->getObjectManagerNameByClassName($hydratorName);

        $doctrineObjectManager = $this->getDoctrineObjectManager();

        if (false === $doctrineObjectManager->has($objectManagerName)) {
            $this->prototype[$hydratorName] = false;
            return false;
        }

        /** @var ObjectManager $objectManager */
        $objectManager = $doctrineObjectManager->get($objectManagerName);

        $r = array_key_exists($hydratorName, $this->reflectionClassCache) ? $this->reflectionClassCache[$hydratorName] : new ReflectionClass($hydratorName);

        $this->prototype[$hydratorName] = $r->newInstance($objectManager);


        return $this->prototype[$hydratorName];
    }
508494
public function adapter($adapter = null)
    {
        if ($adapter === null) {
            return $this->_adapter;
        }

        $this->_adapter = $adapter;
    }
565486
public function quoter($quoter = null)
    {
        if ($quoter !== null) {
            $this->_quoter = $quoter;
        }
        return $this->_quoter;
    }
1271730
public function getHydratorFor($className)
    {
        if (isset($this->hydrators[$className])) {
            return $this->hydrators[$className];
        }
        $hydratorClassName = str_replace('\\', '', $className) . 'Hydrator';
        $fqn = $this->hydratorNamespace . '\\' . $hydratorClassName;
        $class = $this->dm->getClassMetadata($className);

        if ( ! class_exists($fqn, false)) {
            $fileName = $this->hydratorDir . DIRECTORY_SEPARATOR . $hydratorClassName . '.php';
            if ($this->autoGenerate) {
                $this->generateHydratorClass($class, $hydratorClassName, $fileName);
            }
            require $fileName;
        }
        $this->hydrators[$className] = new $fqn($this->dm, $this->unitOfWork, $class);
        return $this->hydrators[$className];
    }
2420
public function hydrate($value)
    {
        if ($this->nullable && $value === null) {
            return null;
        }

        $this->hasOneStrategy->setPrototypeStrategy($this->getPrototypeStrategy());
        $return = clone $this->arrayObjectPrototype;
        if (is_array($value) || $value instanceof \Traversable) {
            foreach ($value as $key => $data) {
                $return[$key] = $this->hasOneStrategy->hydrate($data);
            }
        } else {
            throw new Exception\InvalidArgumentException(sprintf(
                'Value must be null (only if nullable option is enabled), or an array, or a Traversable: "%s" given',
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }

        return $return;
    }
1316495
public function getHydrator()
    {
        if ($this->hydrator) {
            return $this->hydrator;
        }
        return $this->hydrator = new Hydrator($this->metaCacheDir, $this->metaDirs);
    }
1034305
protected function entityToArray(UserEntityInterface $entity, HydratorInterface $hydrator = null)
    {
        if (!$hydrator) {
            $hydrator = $this->getHydrator();
        }

        return $hydrator->extract($entity);
    }
945291
public function getHydrator()
    {
        if (!$this->hydrator) {
            $this->hydrator = new ClassMethods(true);
            $this->hydrator->addFilter(
                'hydrator',
                new MethodMatchFilter(
                    'getHydrator',
                    true // exclude
                ),
                FilterComposite::CONDITION_AND
            );
        }
        return $this->hydrator;
    }
664225
public static function hydrateCollection(array $validators)
    {
        $hydrated = [];

        foreach ($validators as $validator) {
            $hydrated[] = self::hydrate($validator);
        }

        return $hydrated;
    }
1259175
protected function getConfigHelper($serviceName)
    {
        $storage = new HydraTokenStorage();
        $provider = new DefaultServiceProvider($storage);

        $className = $this->getConfigHelperClassName($serviceName);

        return new $className(
            $storage,
            $provider,
            $serviceName
        );
    }