Welcome Guest, Not a member yet? Register   Sign In
Model within a model
#11

(06-29-2021, 12:31 PM)LuxesR Wrote: Is it possible to include a model in the '__construct' and do the same with the other model?

PHP Code:
class Users_model extends \App\Models\BaseModel {

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
 
$this->Settings model('Settings_model');
    }


PHP Code:
class Settings_model extends \App\Models\BaseModel {

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
 
$this->Users model('Users_model');
    }


When I do this, I always get a 503 Service Temporarily Unavailable error. Is there a workaround for this?

because it will create infinite loop. like picture in picture in two mirror sided each other..
Reply


Messages In This Thread
Model within a model - by LuxesR - 06-29-2021, 12:31 PM
RE: Model within a model - by BilltheCat - 06-29-2021, 12:52 PM
RE: Model within a model - by LuxesR - 06-29-2021, 01:47 PM
RE: Model within a model - by BilltheCat - 06-29-2021, 02:06 PM
RE: Model within a model - by paulbalandan - 06-30-2021, 12:54 AM
RE: Model within a model - by InsiteFX - 06-30-2021, 01:58 AM
RE: Model within a model - by LuxesR - 06-30-2021, 02:49 AM
RE: Model within a model - by paulbalandan - 06-30-2021, 07:07 PM
RE: Model within a model - by LuxesR - 07-01-2021, 02:58 AM
RE: Model within a model - by paulkd - 07-01-2021, 12:36 AM
RE: Model within a model - by ikesela - 07-01-2021, 02:59 AM
RE: Model within a model - by paulbalandan - 07-01-2021, 04:25 AM
RE: Model within a model - by LuxesR - 07-01-2021, 05:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB