Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] CI4 Entity using datamap to Model-Save
#3

(07-15-2021, 12:30 AM)InsiteFX Wrote: Did you create an Entity folder in the app folder?
If you did then you access them like this.
PHP Code:
// change this
protected $returnType ActivityEntity::class;

// to this
protected $returnType 'App\Entities\ActivityEntity::class';

// change this
$newActivity = new ActivityEntity();

// to this
$newActivity = new \App\Entities\ActivityEntity(); 
Also did you setup the Entity to use the correct get and set methods?
...Oh, I think I found the problem.
User guide and $datamap comment tell me:
PHP Code:
$datamap = ['db_name' =>'class_name']; 

But it should actually be:
PHP Code:
$datamap = ['class_name' =>'db_name']; 
Reply


Messages In This Thread
RE: CI4 Entity using datamap to Model-Save - by monkenWu - 07-15-2021, 03:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB