Hydrate $object with the provided $data.

@param  array $data
@param  object $object

@return DownloadList
@throws Exception
500164
public function hydrate(array $data, $object)
    {
        if (!$object instanceof DownloadList) {
            throw new Exception('$object must be an instance of Downloadlist');
        }

        return parent::hydrate($data, $object);
    }
604497
public function extract($object)
    {
        if (!$object instanceof DownloadList) {
            throw new Exception('$object must be an instance of Downloadlist');
        }
        /* @var $object DownloadList */
        $data = parent::extract($object);

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

        return parent::hydrate($data, $object);
    }
1054333
protected function hydrateObjectForm($object)
    {
        // Prepare the data that will hydrate the form
        $data = [
            'id'            => $object->getId(),
            'locale'        => $object->getLocale(),
            'title'         => $object->getTitle(),
            'chapo'         => $object->getChapo(),
            'description'   => $object->getDescription(),
            'postscriptum'  => $object->getPostscriptum(),
            'color'         => $object->getColor(),
            'code'          => $object->getCode()
        ];

        $form = $this->createForm(AdminForm::ORDER_STATUS_MODIFICATION, "form", $data);

        // Setup the object form
        return $form;
    }
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];
    }
626993
public function hydrate(array $data, $object)
    {
        $this->prepare($object);

        if ($this->byValue) {
            return $this->hydrateByValue($data, $object);
        }

        return $this->hydrateByReference($data, $object);
    }
1236891
public function hydrate(array $data, $object)
    {
        $object->setId($data['id']);
        $object->setCreatedAt(new \DateTime($data['created_at']));
        $object->setCreatedBy($data['created_by']);
        $object->setComment($data['comment']);
        return $object;
    }
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;
    }
174152
public function hydrate(array $data, $object)
    {
        foreach ($data as $name => $value) {
            $property = StringUtil::camel($name);
            if (property_exists($object, $property)) {
                $object->{$property} = $value;
            }
        }

        return $object;
    }
719485
private function hydrate($object_data) {
    //if (is_array($object_data)) {
      foreach ($object_data as $object_data_key => $object_data_value) {
        if(method_exists($this, $object_data_key)) {
          if ($object_data_value == '') {
            $object_data_value = null;
          }
          $this->{'set'.ucfirst($object_data_key)}($object_data_value);
        }
      }
    //}
    /* else if (is_a($object_data, get_class($this))) {
      foreach ($this->properties() as $properties_key => $properties_value) {
        $this->{'set'.ucfirst($properties_value)}($object_data->$properties_value());
      }
    }/* else {
      throw new XException('00010003', 4, array( 0 => get_class($this) ));
    }*/
  }
277830
public function createFromData(array $data, array $map = null)
    {
        $object = $this->create();
        $this->hydrator->hydrate($data, $object, $map);
        return $object;
    }
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;
    }
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;
    }
264224
public function hydrate(array $data, $object)
    {
        $object->setId($this->getData('id', $data));
        $releasedAt = $this->getData('released_at', $data);
        $object->setReleasedAt(isset($releasedAt) ? new \DateTime($releasedAt) : null);
        $object->setReleasedBy($this->getData('released_by', $data));
        $object->setComment($this->getData('comment', $data));
        return $object;
    }
1238494
public function hydrate(array $data, $object)
    {
        if (!$object instanceof User) {
            throw new \Exception('$object must be an instance of User');
        }

        return parent::hydrate($data, $object);
    }
1360566
protected function runHandler($object, $data = null)
    {
        /** @var ITypedObject $object */
        /** @var ArrayDataObject $data */
        $input = $data->getArray();

        if ($this->dataSource instanceof IValueObjectCollection) {
            /** @var IValueObject $object */
            /** @var IValueObject $newObject */
            $newObject = $this->form->createNewObjectFromInput($input);

            $this->form->invokeBeforeSubmitCallbacks($newObject, $input);
            $this->form->bindToObject($newObject, $input);
            $this->form->invokeOnSubmitCallbacks($newObject, $input);

            $this->dataSource->update($object, $newObject);

            $this->form->invokeOnSaveCallbacks($object, $input);

            return $newObject;
        } else {
            $this->form->invokeBeforeSubmitCallbacks($object, $input);
            $this->form->bindToObject($object, $input);
            $this->form->invokeOnSubmitCallbacks($object, $input);

            $this->dataSource->save($object);

            $this->form->invokeOnSaveCallbacks($object, $input);

            return $object;
        }
    }
538479
public function setObject($object)
    {
        if (!is_object($object)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects an object argument; received "%s"',
                __METHOD__,
                gettype($object)
            ));
        }

        if (property_exists($this, 'hydrator') && $this->hydrator) {
            $values = $this->getHydrator()->extract($object);
            foreach ($this->getFieldsets() as $name => $fieldset) {
                if (isset($values[$name]) && is_object($values[$name])) {
                    $fieldset->setObject($values[$name]);
                }
            }
        }

        if (property_exists($this, 'object')) {
            $this->object = $object;
        }

        return $this;
    }