BUG model common function - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: BUG model common function (/showthread.php?tid=76437) |
BUG model common function - cukikt0302 - 05-12-2020 PHP Code: $Gg = model( $this->modelGG ); RE: BUG model common function - jreklund - 05-12-2020 Hi, what does $this->modelGG and $this->modelGI contain? RE: BUG model common function - cukikt0302 - 05-12-2020 PHP Code: Crud.php RE: BUG model common function - cukikt0302 - 05-12-2020 Oops im sr my bad It worked! Im forgot set 2nd ARG to false $Gg = model( $this->modelGG, false ); $Gi = model( $this->modelGI, false ); var_dump(['gg' => $Gg->table, 'gi' => $Gi->table]) RE: BUG model common function - jreklund - 05-12-2020 Okey, what does $this->modelGG contain? protected = 'BAPI\Models\GG\Crud' or something else? RE: BUG model common function - cukikt0302 - 05-12-2020 It contain protected $modelGG = '\BAPI\Models\modelGG\Crud'; protected $modelGI = '\BAPI\Models\modelGI\Crud'; RE: BUG model common function - jreklund - 05-12-2020 That's odd, it should only be shared on model level, so that you only load GG ones. But it looks like it's picking up something else, maybe the Crud name and assign the previous model again. RE: BUG model common function - cukikt0302 - 05-12-2020 I think so. Seems like forgot to delete the old model or something similar. PHP Code: if (($pos = strrpos($name, '\\')) !== false) RE: BUG model common function - jreklund - 05-12-2020 Hi could you try the following (revert the changes made to ModelFactory): PHP Code: protected $modelGG = '\\BAPI\\Models\\modelGG\\Crud'; Do you get the same result? EDIT: nvm, that should be an escape for \ namespace. Will need to try it out in the weekend. RE: BUG model common function - cukikt0302 - 05-12-2020 (05-12-2020, 01:10 PM)jreklund Wrote: Hi could you try the following (revert the changes made to ModelFactory): It not working bro |