Welcome Guest, Not a member yet? Register   Sign In
Model files in CI4
#10

Thankyou very much Includebeer.

I already had many controllers, multi-level libraries, models in my CI3 version.
The questions are:

1) I'm already grouping many tabel's data into big multi-table objects, i.e:
$GC->Tabella1, from AA_Tabella1,
$GC->Tabella2, from AA_Tabella2...
How can I replicate this in CI4?
1A) in the models, reading multiple tables and constructing there the multi-table objects?
or
1B) in some 0-level libraries, reading from CI4-standard single-tabel models?
Option "1B" can work if I can declare the used model in the library file header, instead of in the controller. May I?

2) $GC is declared "static" in the Controller. So I can handle it with the librarie's functions.
This will not change from CI3 to Ci4, right?

3) In each library I had this header:
protected $CI;
public function __construct()
{
// Assign the CodeIgniter super-object
$this->CI =& get_instance();
}
In this way I can use in the libraries the header of the controller.
How does it work/translate this in CI4?

4) In CI4 standard Model there is a Key declaration:
i.e: protected $primaryKey = 'id';
It assumes that the table has a single key.
90% of my tables have multiple keys, i.e. GameID, ItemID: can the standard CI4 models handle this?
Reply


Messages In This Thread
Model files in CI4 - by Filippo65 - 07-06-2021, 10:39 AM
RE: Model files in CI4 - by MGatner - 07-07-2021, 06:14 AM
RE: Model files in CI4 - by paliz - 07-07-2021, 09:17 AM
RE: Model files in CI4 - by Filippo65 - 07-12-2021, 10:06 AM
RE: Model files in CI4 - by includebeer - 07-12-2021, 03:44 PM
RE: Model files in CI4 - by InsiteFX - 07-12-2021, 09:04 PM
RE: Model files in CI4 - by davis.lasis - 07-13-2021, 03:29 AM
RE: Model files in CI4 - by Filippo65 - 07-14-2021, 11:18 AM
RE: Model files in CI4 - by includebeer - 07-14-2021, 02:23 PM
RE: Model files in CI4 - by Filippo65 - 07-19-2021, 10:57 AM
RE: Model files in CI4 - by includebeer - 07-19-2021, 02:45 PM
RE: Model files in CI4 - by Filippo65 - 07-20-2021, 10:52 AM
RE: Model files in CI4 - by Filippo65 - 07-20-2021, 12:47 PM
RE: Model files in CI4 - by Filippo65 - 07-21-2021, 10:30 AM
RE: Model files in CI4 - by includebeer - 07-23-2021, 04:52 AM
Model files in CI4 - by Filippo65 - 08-20-2021, 09:28 AM
RE: Model files in CI4 - by ikesela - 08-20-2021, 12:50 PM
RE: Model files in CI4 - by includebeer - 09-05-2021, 03:39 PM
RE: Model files in CI4 - by Filippo65 - 09-23-2021, 07:44 AM
RE: Model files in CI4 - by InsiteFX - 09-06-2021, 12:56 AM
RE: Model files in CI4 - by Filippo65 - 09-25-2021, 09:34 AM
RE: Model files in CI4 - by InsiteFX - 09-26-2021, 12:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB