• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
trouble calling function in model

In my controller I have this line and the models used in it work fine. 

For example at one place I call
$this->MyModel->count_qualified_bus_components();  //update the business comps.

I have another module called MyReport. It is a class that extends

class MyReport extends \koolreport\KoolReport
 and it I make a call to My Model. Never mind the crazy KoolReport syntax:

return array(
    "datePicker" => $this->dataStore("campaigns23")->get(0,"taxyear"),
    "BSelect" => $this->MyModel->getTaxyear()

The problem is I get this error:

Severity: Notice
Message: Undefined property: MyReport::$MyModel

Filename: assets/MyReport.php
Line Number: 335

So it appears that functions in MyModel are not callable from this second module. How to fix it? I tried adding in
$this->load->model('MyModel'); to the top of the new module, but this didn't work. 
proof that an old dog can learn new tricks

Messages In This Thread
trouble calling function in model - by richb201 - 01-13-2021, 05:23 AM
RE: trouble calling function in model - by iRedds - 01-14-2021, 07:16 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.