database - Model::save() returns false even though all data saved correctly -
i want update field in table scale. have array:
$s = array( 'id' => '1', 'name' => 'name', 'description' => 'description', 'type' => 'custom' ); and saving this:
$this->scale->save($s); i received error without notofication. it's not validation problem, because have no validation in model. though have error, data saved correctly.
so why save method returns false?
going comments have if structured incorrectly.
<?php if ($this->scale->save($s)) { throw new notsaveexception(); } $this->scale->save() return true in turn throw exception. need exception in else block
the if block should be...
<?php if ($this->scale->save($s)) { // deal success } else { throw new notsaveexception(); }
Comments
Post a Comment