Closed timothymarois closed 7 years ago
Found more issues with return type of object. Within the method update()
must update to
if ($this->useTimestamps && ! array_key_exists($this->updatedField, $data))
{
if (is_object($data)) {
$data->{$this->updatedField} = $this->setDate();
}
else {
$data[$this->updatedField] = $this->setDate();
}
}
(again, its being caused because it believes all data is returned as an array. I would fork and fix these myself, but Im busy on other projects and finding these along the way)
Er, I don't see doProtectFields in the repo !? Is this a support issue or a bug report?
You have raised this in the CodeIgniter3 repo, and it looks like a CodeIgniter4 issue.
Oh.... whoops. This is for CI4. I just realized I'm posting on the wrong Repo.
Currently if you use your models to return data types of
object
instead ofarray
, you will be hit with an error once you try to use thesave()
method. Because of thedoProtectedFields
, to resolve this. the method should look like this (checking if its an object first)