Hydrate $object with the provided $data.

@param  array  $data
@param  PuppetClass $object
@return PuppetClass
341547
public function hydrate(array $data, $object)
    {
        if (isset($data['name'])) {
            $object->setName($data['name']);
        }
        if (isset($data['doc'])) {
            $object->setDocumentation($data['doc']);
        }
        if (isset($data['parameters_definitions']) && is_array($data['parameters_definitions'])) {
            $object->setParametersDefinitions($data['parameters_definitions']);
        }
        if (isset($data['template_definitions']) && is_array($data['template_definitions'])) {
            $object->setParametersTemplates($data['template_definitions']);
        }
        return $object;
    }
1011286
public function hydrate(array $data, $object)
    {
        if (! $object instanceof Entity) {
            return $object;
        }
                
        parent::hydrate($data, $object);
               
        $authEntity = parent::hydrate($data, new \Pacificnm\Auth\Entity\Entity());
        
        $object->setAuthEntity($authEntity);
        
        $aclRoleEntity = parent::hydrate($data, new \Pacificnm\AclRole\Entity\Entity());
        
        $object->getAuthEntity()->setAclRoleEntity($aclRoleEntity);
        
        return $object;
    }
214019
public function hydrate(array $data, $object)
    {
        $object->setId($this->getData('id', $data));
        $createdAt = $this->getData('created_at', $data);
        $object->setCreatedAt(isset($createdAt) ? new \DateTime($createdAt) : null);
        $object->setCreatedBy($this->getData('created_by', $data));
        $object->setComment($this->getData('comment', $data));
        return $object;
    }
1021143
public function hydrate($object, $data)
    {
        if (is_array($data)) {
            foreach ($data as $key => $value) {
                // Check setMethod
                if (!$this->callSetter($object, $this->toCamelCase($key), $value)) {
                    // If no setter is defined, we reinject into array
                    $data[$key] = $value; // Change data with subObject
                }
            }
        }

        return $object;
    }
352326
public function hydrate(array $data, $object)
    {
        if (is_object($object)) {
            $hydrator = $this->getHydrator(get_class($object));
        } else {
            $hydrator = $this->getHydrator($object);
            $object = $hydrator->createEmptyInstance($object, $data);
        }

        return $hydrator->hydrate($data, $object);
    }
891611
public function hydrate(array $data, $object)
    {
        $this->prepare($object);

        if (isset($this->onBeforeHydrate)) {

            if (! isset($this->metadataExtensionClass)) {
                call_user_func_array([$object, $this->onBeforeHydrate], [new HydrationContext($data)]);
            } else {
                call_user_func_array([$this->metadataExtensionClass, $this->onBeforeHydrate], [new HydrationContext($data), $object]);
            }
        }

        $object = parent::hydrate($data, $object);

        if (isset($this->onAfterHydrate)) {

            if (! isset($this->metadataExtensionClass)) {
                call_user_func_array([$object, $this->onAfterHydrate], [new ImmutableHydrationContext($data)]);
            } else {
                call_user_func_array([$this->metadataExtensionClass, $this->onAfterHydrate], [new ImmutableHydrationContext($data), $object]);
            }

        }

        return $object;
    }
1289488
private static function getHydratorClosure($object)
    {
        if (!isset(self::$hydratorClosure)) {
            self::$hydratorClosure = function($object, array $data) {
                foreach ($data as $name => $value) {
                    $object->$name = $value;
                }
            };
        }

        $class = get_class($object);

        if (!isset(self::$hydratorClosureCache[$class])) {
            self::$hydratorClosureCache[$class] = \Closure::bind(self::$hydratorClosure, null, $class);
        }

        return self::$hydratorClosureCache[$class];
    }
149434
public function hydrate(array $data, $object)
    {
        if (!isset($data['tracks'])) {
            return $object;
        }

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

        return $object;
    }
554411
public function hydrate(array $data, $object)
    {
        if (!is_object($object)) {
            throw new RuntimeException(
                sprintf('%s expects the provided $object to be a PHP object', __METHOD__)
            );
        }

        return (function (array $data) {
            foreach ($data as $property => $value) {
                if (!property_exists($this, $property)) {
                    throw new RuntimeException(
                        sprintf(
                            'Property "%s" does not exist in "%s" class.',
                            $property,
                            get_class($this)
                        )
                    );
                }

                $this->{$property} = $value;
            }

            return $this;
        })->call($object, $data);
    }
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);
    }
421653
private static function getHydrator($object)
    {
        $class = get_class($object);

        if (!isset(self::$hydratorCache[$class])) {
            $configuration = new Configuration($class);
            $hydratorClass = $configuration->createFactory()->getHydratorClass();

            self::$hydratorCache[$class] = new $hydratorClass;
        }

        return self::$hydratorCache[$class];
    }
736025
private function getHydrator($object)
    {
        $class = get_class($object);

        if (!isset(self::$hydratorCache[$class])) {
            $hydratorClass = $this->generator->getHydratorClass($class);

            self::$hydratorCache[$class] = new $hydratorClass;
        }

        return self::$hydratorCache[$class];
    }
318714
public function hydrate(array &$data, $object)
    {
        foreach ($data as $property => $value) {
            $this->hydrateProperty($property, $value, $object);
        }
        
        return $object;
    }
783082
public function hydrate( array $data, $object )
    {
        $type = $object->paragraph->type;

        if ( isset( $data['paragraph-' . $type] ) )
        {
            $this->getParagraphMapper()
                 ->hydrate( (array) $data['paragraph-' . $type],
                            $object->paragraph );
        }

        $propertyHydrator = $this->getHydrateSimpleProperties();

        foreach ( $object->rules as $key => $rule )
        {
            if ( isset( $data['customize-' . $key] ) )
            {
                $ruleData = array(
                    'properties' => (array) $data['customize-' . $key],
                );

                $propertyHydrator->hydrate( $ruleData, $rule );
            }
        }

        return $object;
    }
712790
public function hydrate(array $data, $object)
    {
        if (!$object instanceof Entity) {
            throw new \InvalidArgumentException('$object must be an instance of Password entity');
        }
        if (! $data['request_time'] instanceof \DateTime) {
            $data['request_time'] = new \DateTime($data['request_time']);
        }

        return parent::hydrate($data, $object);
    }
568704
public function hydrate(array $data, $object)
    {
        if (isset($data['forge-name'])) {
            $object->setName($data['forge-name']);
        } elseif (isset($data['name'])) {
            $object->setName($data['name']);
        }
        if (isset($data['inherited'])) {
            $object->setInherited($data['inherited']);
        }
        if (isset($data['version'])) {
            $object->setVersion($data['version']);
        }
        if (isset($data['source'])) {
            $object->setSource($data['source']);
        }
        if (isset($data['project_page'])) {
            $object->setProjectPage($data['project_page']);
        }
        if (isset($data['issues_url'])) {
            $object->setIssuesUrl($data['issues_url']);
        }
        if (isset($data['author'])) {
            $object->setAuthor($data['author']);
        }
        if (isset($data['summary'])) {
            $object->setSummary($data['summary']);
        }
        if (isset($data['license'])) {
            $object->setLicense($data['license']);
        }
        return $object;
    }
791161
public function hydrate(array &$data)
    {
        $entity = new $this->className();
        // To fix a bug: Ldap column name is always to lower case
        $column = array();
        foreach ($this->analyzer->listColumns() as $name => $info) {
            $column[strtolower($name)] = array_merge($info, array('realname' => $name));
        }

        foreach ($data as $key => $value) {
            $keyLow = strtolower($key);

            if (!array_key_exists($keyLow, $column)) {
                if ($keyLow === 'objectclass') {
                    foreach ($value as $objectClass) {
                        if (!$entity->getObjectClass()->contains($objectClass)) $entity->addObjectClass($objectClass);
                    }
                }
                continue;
            }

            if (is_array($value) && $column[$keyLow]['type'] === 'string') {
                if (!$column[$keyLow]['strict'] || !OpenLdapObject::isStrict()) {
                    // If is not strict, given the first element of the array
                    $value = reset($value);
                } else {
                    throw new InvalidHydrateException('Column ' . $key . ' define as a string but data is array');
                }
            }

            if ($column[$keyLow]['type'] === 'array') {
                // $method = 'add' . Utils::capitalize($column[$keyLow]['realname']);
                if (!is_array($value)) {
                    $data[$key] = array($value);
                    $value = array($value);
                }
                $property = $this->analyzer->getReflection()->getProperty($column[$keyLow]['realname']);
                $isAccessible = $property->isPublic();
                $property->setAccessible(true);
                $property->setValue($entity, new ArrayCollection($value));
                if (!$isAccessible) {
                    $property->setAccessible(false);
                }
            } elseif ($column[$keyLow]['type'] === 'entity') {
                $multi = $this->analyzer->isEntityRelationMultiple($column[$keyLow]['realname']);
                if ($multi) {
                    $property = $this->analyzer->getReflection()->getProperty($column[$keyLow]['realname']);
                    $isAccessible = $property->isPublic();
                    $property->setAccessible(true);
                    // Manage multi entity but only one
                    if (!is_array($value)) {
                        $data[$key] = array($value);
                        $value = array($value);
                    }
                    $property->setValue($entity, new EntityCollection(EntityCollection::DN, $this->em->getRepository($column[$keyLow]['relation']['classname']), $value, array('ignore_errors' => $column[$keyLow]['relation']['ignore_errors'])));
                    if (!$isAccessible) {
                        $property->setAccessible(false);
                    }
                } else {
                    $method = 'set' . Utils::capitalize($column[$keyLow]['realname']);
                    $entity->$method($this->em->getRepository($column[$keyLow]['relation']['classname'])->read($value));
                }
            } else {
                $method = 'set' . Utils::capitalize($column[$keyLow]['realname']);
                $entity->$method($value);
            }
        }

        return $entity;
    }