tombenner / wp-mvc

An MVC framework for WordPress
http://wpmvc.org
MIT License
624 stars 172 forks source link

Updating model gives unknown column__model_name #254

Open bolivir opened 4 years ago

bolivir commented 4 years ago

Hi,

Im not sure if im doing the updates on an model correct. I saw in another issue an example, but it is not working and throws me an unknown column __model_name error.

This is what i am doing: $model = mvc_model('UserMeta'); $userMetaData = $model->find_one_by_verify_token($this->params['token']); if ($userMetaData && $userMetaData->verify_token_valid_until > strtotime('now')) { $userMetaData->verified = 1; $userMetaData->verify_token_valid_until = null; $userMetaData->verify_token = ''; $model->save($userMetaData); }

Weird enough if i unset __model_name and the __id field it is updating the model.