Hydrate $object with the provided $data.

@param  array $data
@param  object|string $object object or class name
@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);
    }
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;
    }
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);
    }
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;
    }
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;
    }
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);
    }
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;
    }
511339
protected function hydrateObjectForm($object)
    {
        $data = array(
            "id" => $object->getId(),
            "visible" => (bool) $object->getVisible(),
            "code" => $object->getCode(),
            "title" => $object->getTitle(),
            "type" => $object->getType(),
            "entity" => $object->getEntity(),
            "serialized_columns" => $object->getSerializedColumns(),
            "serialized_condition" => $object->getSerializedCondition(),
            "index_engine_driver_configuration_id" => $object->getIndexEngineDriverConfigurationId(),
        );

        return $this->getUpdateForm($data);
    }
491304
public function hydrate(array $data, $object)
    {
        foreach ($data as $name => $value) {
            if (!isset($this->profileClassMap[$name])) {
                continue;
            }
            
            if (empty($value)) {
                // We need to check, if collection has a profile and
                // remove it.
                foreach ($object as $p) {
                    if ($p instanceof $this->profileClassMap[$name]) {
                        $object->removeElement($p);
                        continue 2;
                    }
                }
                // No profile found, so do nothing.
                continue;
            }
            
            if (is_string($value)) {
                $value = \Zend\Json\Json::decode($value, \Zend\Json\Json::TYPE_ARRAY);
            }

            /* If there is already a profile of this type, we do not need to
             * add it, but update the data only.
             */
            foreach ($object as $p) {
                if ($p instanceof $this->profileClassMap[$name]) {
                    // Already a profile in the collection, just update and continue main loop.
                    $p->setData($value);
                    continue 2;
                }
            }
                
            // We need to add a new profile to the collection.
            $class = $this->profileClassMap[$name];
            $profile = new $class();
            $profile->setData($value);
            $object->add($profile);
        }
        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);
    }
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;
    }
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;
    }
1229253
public function hydrate(array $data, $object)
    {
        $methods = array_flip(get_class_methods(get_class($object)));
        $class = get_class($object);

        foreach ($data as $key => $value) {
            $method = StringUtil::camel('set_' . $key);

            if (!isset($methods[$method])) {
                continue;
            }

            $object->$method($this->getValue($class, $method, $value));
        }

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

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

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

        return parent::hydrate($data, $object);
    }
1077191
public function hydrate(array $data, $object)
    {
        if (!$object instanceof BlockEntityInterface) {
            throw new Exception\InvalidArgumentException(
                '$object must be an instance of PlaygroundCms\Entity\BlockInterface'
            );
        }
        //$data = $this->mapField('block_id', 'id', $data);
        return parent::hydrate($data, $object);
    }