Update the criteria information stored in the database

@param array $data Form data
497781
public function update_config(&$data) {

        if (!empty($data->criteria_course) && is_array($data->criteria_course)) {

            $this->course = $data->id;

            foreach ($data->criteria_course as $course) {

                $this->courseinstance = $course;
                $this->id = NULL;
                $this->insert();
            }
        }
    }
86618
public function update($data)
    {
        if (count($this) == 0) {
            return;
        }
        $ids = $this->getPrimaryKeyList();
        $updater = new $this->className();
        $updater->in($updater->getPrimaryKey(), $ids)->update($data);
    }
704452
protected function onInput($data)
    {
        if (is_array($this->params)) {
            foreach ($this->params as $columnName => $columnInfo) {
                if (isset($columnInfo["name"])) {
                    $columnValue = $data[$columnName];
                    unset($data[$columnName]);
                    $data[$columnInfo["name"]] = $columnValue;
                }
            }
        } else {
            foreach ($this->nameMap as $oldName => $newName) {
                $value = $data[$oldName];
                unset($data[$oldName]);
                $data[$newName] = $value;
            }
        }
        $this->next($data);
    }
647029
public function setData($data)
    {
        $resultData = $this->hydrateIfJsonToArray($data);
        if (!empty($resultData)) {
            $this->data = $resultData;
        }
        else {
            $this->data = [];
        }
    }
344446
public function updateNewsletter(array $data)
    {
        $user = $this->getAuthService()->getIdentity();
        $optinChange = false;
        $optin2Change = false;
        $optinPartnerChange = false;

        // I trigger an optin event before updating user if it has changed .
        if (isset($data['optin']) && $user->getOptin() != $data['optin']) {
            $optinChange = true;
            $this->getEventManager()->trigger(__FUNCTION__.'.pre', $this, array('user' => $user, 'data' => $data));
            $user->setOptin($data['optin']);
        }

        // I trigger an optin2 event before updating user if it has changed .
        if (isset($data['optin2']) && $user->getOptin2() != $data['optin2']) {
            $optin2Change = true;
            $this->getEventManager()->trigger(__FUNCTION__.'.pre', $this, array('user' => $user, 'data' => $data));
            $user->setOptin2($data['optin2']);
        }

        // I trigger an optinPartner event before updating user if it has changed
        if (isset($data['optinPartner']) && $user->getOptinPartner() != $data['optinPartner']) {
            $optinPartnerChange = true;
            $this->getEventManager()->trigger(__FUNCTION__.'Partner.pre', $this, array('user' => $user, 'data' => $data));
            $user->setOptinPartner($data['optinPartner']);
        }

        $form  = $this->getServiceManager()->get('playgrounduser_newsletter_form');
        $form->bind($user);
        $form->setData($data);

        /*if (!$form->isValid()) {
            return false;
        }*/

        $user = $this->getUserMapper()->update($user);
        if ($optinChange) {
            $this->getEventManager()->trigger(__FUNCTION__.'.post', $this, array('user' => $user, 'data' => $data));
        }

        if ($optin2Change) {
            $this->getEventManager()->trigger(__FUNCTION__.'.optin2.post', $this, array('user' => $user, 'data' => $data));
        }

        if ($optinPartnerChange) {
            $this->getEventManager()->trigger(__FUNCTION__.'Partner.post', $this, array('user' => $user, 'data' => $data));
        }

        return $user;
    }
896746
protected function onInput($data)
    {
        //Process data here
        foreach ($this->params as $cName => $cParams) {
            $value = null;
            foreach ($cParams as $cValue => $criteria) {
                $from = Utility::get($criteria, 0);
                $to = Utility::get($criteria, 1);
                if (($from == null || $from <= $data[$cName]) && ($to == null || $data[$cName] < $to)) {
                    $value = $cValue;
                }
            }
            $data[$cName] = ($value) ? $value : null;
        }
        $this->next($data);
    }
354139
public function update(array $data)
    {
        try
        {
            if ($this->validator->with($data)->validForUpdate())
            {
                $this->groups->update($data);
                return true;
            }
        }
        catch (GroupExistsException $e)
        {
            $this->validator->add('GroupExistsException', $e->getMessage());
        }
        catch (NameRequiredException $e)
        {
            $this->validator->add('NameRequiredException', $e->getMessage());
        }

        return false;
    }
842042
private function getUpdateQuery(array $data)
    {
        //This is a hack to prevent parameters being mixed up.
        $tempParameters   = $this->parameters;
        $this->parameters = [];

        $query = $this->applyFilters(
            $this->queryBuilder
                ->update($this->entity->getTable())
                ->values($this->parameters($data))
        );

        $this->parameters = array_merge($this->parameters, $tempParameters);

        return $query;
    }
971496
protected function _update(array $data)
    {
        $data = $this->_setData($data);
        $pmk = $this->getPrimaryKey();
        unset($data[$pmk]);
        $sql = Sql::createSql($this->getAdapter())->update($this->getTableName());
        $event = new Save([
            'action' => Save::UPDATE,
            'data' => $data,
            'abort' => false
        ]);
        $this->getEventManager()->trigger(Save::BEFORE_SAVE, $this, $event);
        if ($event->abort) {
            return false;
        }
        $sql->set($event->data)
            ->where(["{$pmk} = :id" => [':id' => $this->$pmk]])
            ->execute();
        $this->getEventManager()->trigger(Save::AFTER_SAVE, $this, $event);
        return true;
    }
233030
public function set(array $data)
    {
        $this->data = [];
        $this->replace = false;

        foreach ($data as $key => $value) {
            $this->add($key, $value);
        }
    }
78229
function update($data)
    {
        $update = "";
        foreach ($data as $key => $value)
        {
            $value = $this->db->quote($value);
            if ($value != '' and $value{0} == '`')
            {
                $update = $update . "`$key`=$value,";
            }
            else
            {
                $update = $update . "`$key`='$value',";
            }
        }
        $update = substr($update, 0, -1);
        return $this->db->query("update {$this->table} set $update {$this->where} {$this->limit}");
    }
919046
public function update_config(&$data) {
        if (!empty($data->criteria_date)) {
            $this->course = $data->id;
            $this->timeend = $data->criteria_date_value;
            $this->insert();
        }
    }
560685
public function update(array $data)
    {
        // setup the custom options
        foreach ($this->getCustomOptions() as $key => $value) {
            if (isset($data[$value]) && $data[$value] == 'custom' && $data[$value . '_custom'] != '') {
                $data['_form_' . $value] = $data[$value];
                $data[$value] = $data[$value . '_custom'];
            }
        }
        
        foreach ($data as $key => $value) {
            if (in_array($key, $this->getSerialized())) {
                $value = (is_array($value) ? serialize($value) : serialize(array(
                    $value
                )));
            }
            
            if (in_array($key, $this->getEncrypted()) && $value != '') {
                $value = $this->getEncrypt()->encode($value);
            }
            
            $this->updateSetting($key, $value);
        }
        
        return true;
    }
57674
public function fill(array $data)
    {
        foreach ($data as $key => $value) {
            if (in_array($key, $this->fillable)) {
                $this->{$key} = $value;
            }
        }
    }
911619
public function update(array $data)
    {
        $affected = 0;
        foreach ($this->table->data['data'] as &$rs) {
            if ($this->matchWhere($rs)) {
                $rs = array_merge($rs, $data);
                $affected++;
            }
        }

        if ($affected) {
            $this->table->save();
        }

        return $affected;
    }
584820
public function setData(array $data = [])
    {
        $this->default = empty($data);

        $this->data = array_replace([
            static::VISIBLE_COLUMNS => [],
            static::MAX_PER_PAGE    => null,
            static::CONFIG          => null,
            static::PAGE_NUM        => null,
            static::SORT            => null,
            static::ADD_FILTER      => null,
            static::REMOVE_FILTER   => null,
            static::IDENTIFIERS     => [],
            static::ALL             => null,
            static::BATCH           => null,
            static::ACTION          => null,
            static::EXPORT          => null,
            static::FORMAT          => null,
            static::PROFILE         => [],
        ], $data);
    }
1207321
public function update(array $data)
    {
        $template = Basecamp::templates()->update($this->id, $data);

        $this->setAttributes($template);

        return $template;
    }