Hydrate $object with the provided $data.

@param  array $data
@param  object $object
@return object
11311
public function hydrate(array $data, $object)
    {
        if (!isset($data['album'])) {
            return $object;
        }

        $hydrators = new AggregateHydrator();
        $hydrators->add(new AlbumHydrator());
        $hydrators->add(new ImageCollectionAwareHydrator());

        $object->setAlbum($hydrators->hydrate($data['album'], new Album()));

        return $object;
    }
802651
public function hydrate(array $data, $objectOrClass, array $map = null)
    {
        if (\is_object($objectOrClass)) {
            $object = $objectOrClass;
            $reflection = $this->getReflection(\get_class($object));
        } else {
            $reflection = $this->getReflection($objectOrClass);
            $object = $reflection->newInstanceWithoutConstructor();
        }

        if (!\is_array($map) || !$map) {
            $map = \array_keys($data);
            $map = \array_combine($map, $map);
        }
        foreach ($map as $fieldName => $propertyName) {
            if (isset($data[$fieldName]) && $reflection->hasProperty($propertyName)) {
                $property = $this->getProperty($reflection, $propertyName);
                $property->setValue($object, $data[$fieldName]);
            }
        }

        return $object;
    }
116199
public function hydrate($objectClass, array $data, $indexOfBy = false)
    {
        $this->objectClass = $objectClass;

        if (0 == count($data)) {

            yield $this->createObjectToHydrate($this->objectClass);
        } elseif (! is_array(current($data))) {

            yield $this->hydrateItem($this->objectClass, $data);
        } elseif (false === $indexOfBy) {

            foreach ($data as $item) {
                yield $this->hydrateItem($this->objectClass, $item);
            }
        } else {

            foreach ($this->hydrateBy($data, $indexOfBy) as $valueOfBy => $item) {
                yield $valueOfBy => $item;
            }
        }
    }
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');
	}
1160491
public static function setDataOptionAttributes($data, $object)
    {
        if(is_array($data) && count($data) > 0)
        {
            $keys = array_keys($data);

            $response = '';
            foreach($keys as $key)
            {
                $response .= ' data-' . $key . '="' . $object->{$data[$key]} . '"';
            }

            return $response;
        }

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

        return parent::hydrate($data, $object);
    }
1230921
protected function hydrateObjectForm($object)
    {
        $data = array(
            'id' => $object->getId(),
            'locale' => $object->getLocale(),
            'visible' => $object->getVisible() ? true : false,
            'country_id' => $object->getCountryId(),
            'title' => $object->getTitle(),
            'isocode' => $object->getIsocode(),
        );

        return $this->createForm(AdminForm::STATE_MODIFICATION, 'form', $data);
    }
757475
protected function hydrateObjectForm($object)
    {
        // Hydrate the "SEO" tab form
        $this->hydrateSeoForm($object);

        // Prepare the data that will hydrate the form
        $data = array(
            'id'           => $object->getId(),
            'locale'       => $object->getLocale(),
            'title'        => $object->getTitle(),
            'chapo'        => $object->getChapo(),
            'description'  => $object->getDescription(),
            'postscriptum' => $object->getPostscriptum(),
            'visible'      => $object->getVisible(),
            'parent'       => $object->getParent()
        );

        // Setup the object form
        return $this->createForm(AdminForm::FOLDER_MODIFICATION, "form", $data);
    }
868111
private function update($object, array $data)
    {
        //only save when a change is detected
        if (!empty($data)) {
            $queryBuilder = $this->manager->getDriver()->getQueryBuilder();
            $primaryKey   = $this->getPrimaryKey();

            $this->manager->postPendingQuery(
                new PendingQuery(
                    $this,
                    PendingQuery::TYPE_UPDATE,
                    $queryBuilder
                        ->update($this->getTable())
                        ->values($queryBuilder->createPositionalParameter($data))
                        ->where(
                            $queryBuilder->expression()->eq(
                                $primaryKey,
                                $queryBuilder->createPositionalParameter(
                                    $this->getState($object)->getOriginalFieldData($primaryKey)
                                )
                            )
                        )
                )
            );
        }

        return $this->getPrimaryKeyValue($object);
    }
756787
public function hydrate(array $data, $entity)
    {
        $this->hydrateEntityProperties($entity, $data);
        
        $repository = $this->getRepository();
        $repository->dispatchEvent(ORMEvents::onEntityLoad, new EntityLifecycleEvent($repository, $entity));
        
        return $entity;
    }
1226365
public function hydrateObject($object, $source)
    {
        foreach ($source as $name => $section)
        {
            if (isset($this->extensions[$name])) {
                $this->extensions[$name]->hydrate($object, $section, $this);
            }
        }
    }
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);
    }
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;
    }
587340
public function create($data, $class)
    {
        return is_object($data) ? $data : $this->hydrate(is_array($data) ? $data : [$data], $class);
    }
71954
protected function hydrateObjectForm($object)
    {
        $data = array(
            "id" => $object->getId(),
            "code" => $object->getCode(),
            "driver_code" => $object->getDriverCode(),
            "title" => $object->getTitle(),
            "serialized_configuration" => $object->getSerializedConfiguration(),
        );

        return $this->getUpdateForm($data);
    }
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);
    }
820972
public function hydrate(array $data, $object)
    {
        $object->setId($this->getData('id', $data));
        $object->setName($this->getData('name', $data));
        $object->setType($this->getData('type', $data));
        $object->setOrdering($this->getData('ordering', $data));
        $object->setIncludePattern($this->getData('include_pattern', $data));
        $object->setExcludePattern($this->getData('exclude_pattern', $data));
        return $object;
    }