Hydrate $object with the provided $data.
@param  array $data
@param  object $object
@return TicketEntry
@throws \InvalidArgumentException
773120
public function hydrate(array $data, $object)
    {
        if (!$object instanceof TicketEntry) {
            throw new \InvalidArgumentException('$object must be an instance of TicketEntry');
        }

        return parent::hydrate($data, $object);
    }
958256
public function hydrate(array $data, $object)
    {
        if (!$object instanceof Request) {
            throw new \Exception('$object must be an instance of Request');
        }

        return parent::hydrate($data, $object);
    }
130838
private function hydrateClassObject($obj, $data)
    {
        // loop through the class object and hydrate it
        foreach ($data as $property => $value) {
            $this->hydrate($obj, $property, $value);
        }

        return $obj;
    }
877810
public function hydrate(array $data, $object)
    {
        $object->setType($data['type'])
            ->setData($data['data'])
            ->setStore($data['store'])
            ->setDownload($data['download'])
            ->setOutputFilename($data['output_filename'])
            ->setCategory($data['category']);

        return $object;
    }
1047680
public function toObject(array $data, $object)
    {
        $className = $this->getFullClassName($object);
        $metadata = $this->metadataFactory->getMetadataForClass($className);
        $unserializedProperties = 0;
        foreach ($metadata->getProperties() as $property) {
            if (!$property->isExpose() || $this->propertySkipper->shouldSkip($property)) {
                if ($this->isMediumStrictUnserializeMode() && array_key_exists($property->getSerializedName(), $data)) {
                    throw new InvalidArgumentException(sprintf('%s extra field', $property->getSerializedName()));
                }
                continue;
            }

            if (!array_key_exists($property->getSerializedName(), $data)) {
                if ($this->isStrictUnserializeMode()) {
                    throw new InvalidArgumentException(sprintf('%s field is lost', $property->getSerializedName()));
                }
                continue;
            }
            $value = $this->handleValue($data[$property->getSerializedName()], $property, self::DIRECTION_UNSERIALIZE, $object);

            if ($value === $object) {
                throw new RecursionException(sprintf('Invalid self reference detected. %s::%s', $className, $property->getName()));
            }

            $this->involveValue($object, $property, $value);
            $unserializedProperties ++;
        }

        if ($this->isMediumStrictUnserializeMode() && $unserializedProperties !== count($data)) {
            throw new InvalidArgumentException('Wrong number of fields in the deserialized data');
        }

        return $object;
    }
239327
function setData($object, array $data)
    {
        if (! $this->has($object) )
            throw new \Exception('Object Not Found.');

        if ($data == array_values($data))
            throw new \InvalidArgumentException('Data tags must be associative array.');


        $hash = $this->genETag($object);
        $this->_objs[$hash]['data'] = $data;
        return $this;
    }
1245510
public function update($data, $object)
	{
		$updated = $object->update($data);

		// @todo: Double Check that we should be returning updated not object
		if( ! $updated)
		{
			return new Payload($object , 'not_updated');
		}

		return new Payload($object, 'updated');
	}
533458
protected function hydrateObjectForm($object)
    {
        $data = [
            'id'        => $object->getId(),
            'hook_id'   => $object->getHookId(),
            'module_id' => $object->getModuleId(),
            'classname' => $object->getClassname(),
            'method'    => $object->getMethod(),
            'active'    => $object->getActive(),
            'templates' => $object->getTemplates(),
        ];

        return $this->createForm(AdminForm::MODULE_HOOK_MODIFICATION, 'form', $data);
    }
627899
public function update($data, $object)
	{
		// Process data given.
		$processPayload = $this->process(__FUNCTION__, $data);

		if( ! $processPayload->isStatus(Payload::STATUS_VALID))
		{
			return $processPayload;
		}

		return $this->dataSource->update($processPayload->getData(), $object);
	}
318714
public function hydrate(array &$data, $object)
    {
        foreach ($data as $property => $value) {
            $this->hydrateProperty($property, $value, $object);
        }
        
        return $object;
    }
325766
public function make($object)
    {
        $manager = Manager::getInstance();

        // Instantiate hydrator
        // TODO: We'll need to optimize this and allow pre-generation
        //       of these hydrators, and get it, ideally, from the entityMap or
        //       the Mapper class, so it's only instantiated once
        $config = new Configuration(get_class($object));

        $hydratorClass = $config->createFactory()->getHydratorClass();
        $hydrator = new $hydratorClass();

        if ($manager->isValueObject($object)) {
            $entityMap = $manager->getValueMap($object);
        } else {
            $entityMap = $manager->mapper($object)->getEntityMap();
        }

        // Build Wrapper
        return new ObjectWrapper($object, $entityMap, $hydrator);
    }
563336
public function fill($object, array $data)
    {
        if (! $object instanceof ConversionInterface) {
            throw new InvalidArgumentException(sprintf(
                'Invalid object "%s" provided; must be an instance of "%s".',
                is_object($object) ? get_class($object) : gettype($object),
                ConversionInterface::CLASS
            ));
        }
        $object->fromArray($data);
    }
536213
public function hydrate( array $data, $object )
    {
        if ( isset( $data['properties'] ) &&
             is_array( $data['properties'] ) )
        {
            foreach ( $data['properties'] as $key => $value )
            {
                $newKey = String::decamelize( $key );

                if ( $newKey != $key )
                {
                    $data['properties'][$newKey] = $value;
                    unset( $data['properties'][$key] );
                }
            }
        }

        return $this->getMapper()
                    ->hydrate( $data, $object );
    }
1124241
protected function hydrateObjectForm($object)
    {
        $data = array(
            'area_id' => $object->getId(),
            'name' => $object->getName()
        );

        return $this->createForm(AdminForm::AREA_MODIFICATION, 'form', $data);
    }
149434
public function hydrate(array $data, $object)
    {
        if (!isset($data['tracks'])) {
            return $object;
        }

        $object->setTracks(new Tracks($data['tracks']));

        return $object;
    }
56972
public function hydrate(array $data, $object)
    {
        parent::hydrate($data, $object);
        if (isset($data['certname'])) {
            $object->setName($data['certname']);
        }
        if (isset($data['facts-timestamp'])) {
            $object->setReportedAt(new \DateTime($data['facts-timestamp']));
        }
        if (isset($data['facts-environment'])) {
            $object->setEnvironment($data['facts-environment']);
        }
        return $object;
    }
867722
public function hydrate(&$object, $data, $soft = false, $maxReferenceDepth = 10)
    {
        $strategy = $this->documentManager->getOptions()['hydratorStrategy'] ?? self::STRAT_SETTERS;
        $reflectionClass = new \ReflectionClass($this->classMetadata->getName());
        if ($data instanceof \MongoDB\Model\BSONArray || $data instanceof \MongoDB\Model\BSONDocument) {
            $data = (array) $data;
        }

        if (!is_array($data)) {
            throw new \Exception('$data must be an array');
        }
        $properties = $this->classMetadata->getPropertiesInfos();

        foreach ($properties as $name => $infos) {
            $setter = 'set' . ucfirst($name);
            if (!$reflectionClass->hasMethod($setter) || $strategy === self::STRAT_ATTRIBUTES) {
                $prop = new \ReflectionProperty($this->classMetadata->getName(), $name);
                $prop->setAccessible(true);
            } else {
                $prop = null;
            }

            if (null !== ($field = $infos->getField())) {
                if (!$soft && !array_key_exists($field, $data)) {
                    $this->setValue($object, null, $setter, $prop);
                } elseif (array_key_exists($field, $data)) {
                    if (!$soft && $data[$field] === null) {
                        continue;
                    }
                    if ((($data[$field] instanceof \MongoDB\Model\BSONDocument) || is_array($data[$field])) && $infos->getEmbedded() && null !== ($class = $infos->getEmbeddedClass())) {
                        if ($infos->isDiscriminable()) {
                            if (null !== ($discrimatorField = $infos->getDiscriminatorField())
                                && null !== ($discrimatorMap = $infos->getDiscriminatorMap())) {
                                $discriminatorValue = isset($data[$field][$discrimatorField]) ? $data[$field][$discrimatorField] : null;
                                if (isset($discriminatorValue)) {
                                    $class = isset($discrimatorMap[$discriminatorValue]) ? $discrimatorMap[$discriminatorValue] : $class;
                                }
                            } else {
                                $discriminatorValue = isset($data[$field]) ? $data[$field] : null;
                                $method = $infos->getDiscriminatorMethod();
                                $class = $object->$method($discriminatorValue);
                            }
                        }
                        if (!class_exists($class)) {
                            $class = $this->classMetadata->getNamespace() . "\\" . $class;
                        }
                        if ($data[$field] instanceof $class) {
                            $embedded = $data[$field];
                        } else {
                            $embedded = new $class();
                            $this->getHydrator($class)->hydrate($embedded, $data[$field]);
                        }
                        $data[$field] = $embedded;
                    } elseif ((($data[$field] instanceof \MongoDB\Model\BSONArray) || ($data[$field] instanceof \MongoDB\Model\BSONDocument) || is_array($data[$field])) && $infos->getMultiEmbedded() && null !== ($class = $infos->getEmbeddedClass())) {
                        $array = [];
                        $originalClass = $class;
                        foreach ($data[$field] as $key => $value) {
                            if ($infos->isDiscriminable()) {
                                if (null !== ($discrimatorField = $infos->getDiscriminatorField())
                                    && null !== ($discrimatorMap = $infos->getDiscriminatorMap())) {
                                    $discriminatorValue = isset($data[$field][$key][$discrimatorField]) ? $data[$field][$key][$discrimatorField] : null;
                                    if (isset($discriminatorValue)) {
                                        $class = isset($discrimatorMap[$discriminatorValue]) ? $discrimatorMap[$discriminatorValue] : $originalClass;
                                    }
                                    if (!class_exists($class)) {
                                        $class = $this->classMetadata->getNamespace() . "\\" . $class;
                                    }
                                } else {
                                    //call_s
                                }
                            }
                            if (!class_exists($class)) {
                                $class = $this->classMetadata->getNamespace() . "\\" . $originalClass;
                            }
                            if ($value === null) {
                                continue;
                            }

                            if ($value instanceof $class) {
                                $embedded = $value;
                            } else {
                                $embedded = new $class();
                                $this->getHydrator($class)->hydrate($embedded, $value);
                            }
                            $array[$key] = $embedded;
                        }
                        $data[$field] = $array;
                    } elseif (null !== ($refInfos = $infos->getReferenceInfo()) && !$refInfos->getIsMultiple() && $maxReferenceDepth > 0) {
                        $repository = $this->repositoryFactory->getRepository($this->documentManager, $refInfos->getDocument(), $refInfos->getCollection());

                        $objectDatas = $repository->getCollection()->findOne(["_id" => $data[$field]]);
                        $referedObject = null;

                        if (isset($objectDatas)) {
                            $class = $refInfos->getDocument();

                            if (!class_exists($class)) {
                                $class = $this->classMetadata->getNamespace() . "\\" . $class;
                            }

                            $referedObject = new $class();

                            $hydrator = $repository->getHydrator();
                            $hydrator->hydrate($referedObject, $objectDatas, $soft, $maxReferenceDepth - 1);
                        }
                        $data[$field] = $referedObject;
                    } elseif (null !== ($refInfos = $infos->getReferenceInfo()) && $refInfos->getIsMultiple()) {
                        $repository = $this->repositoryFactory->getRepository($this->documentManager, $refInfos->getDocument(), $refInfos->getCollection());

                        if (!$data[$field] instanceof \MongoDB\Model\BSONArray && !is_array($data[$field])) {
                            throw new \Exception("RefersMany value must be an array for document with '_id' : " . $data["_id"]);
                        } else {
                            $objectsDatas = $repository->getCollection()->find(["_id" => ['$in' => $data[$field]]]);
                        }

                        $objectArray = null;

                        if (!empty($objectsDatas)) {
                            $objectArray = [];
                            foreach ($objectsDatas as $objectDatas) {
                                $class = $refInfos->getDocument();

                                if (!class_exists($class)) {
                                    $class = $this->classMetadata->getNamespace() . "\\" . $class;
                                }

                                $referedObject = new $class();

                                $hydrator = $repository->getHydrator();
                                $hydrator->hydrate($referedObject, $objectDatas, $soft, $maxReferenceDepth - 1);

                                $objectArray[] = $referedObject;
                            }
                        }
                        $data[$field] = $objectArray;
                    }

                    $this->setValue($object, $data[$field], $setter, $prop);
                }
            }
        }
    }