Welcome Guest, Not a member yet? Register   Sign In
Entity with Model finder (custom setters)
#2

Maybe return solution? And ohter drivers


PHP Code:
        if (is_subclass_of($classNameEntity::class)) {
            return empty($data $this->fetchAssoc()) ? false : (new $className())->fill($data)->syncOriginal();
        

If you completely remove the check on the Entity (and the private class), then fetch_object () does not call setters, it will immediately assign values to private properties. Therefore, the situation needs to be corrected.

If I do fill() then everything works fine - private properties are set and $attributes are filled in my setters
Simple CI 4 project for beginners codeigniter-expenses
Reply


Messages In This Thread
RE: Entity with Model finder (custom setters) - by ozornick - 10-11-2022, 07:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB