Please be kind and ask me more information if you need. Please be sure I tried all I could not to create a yet another question
I need access to a method of a model, inside a parallel model.
model class A1;
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class myClassA1 extends Jsonable
{
protected $myClassA1;
protected function __construct(){
public function getWhatINeed(){
return $this->getWhatINeed;
}
}
I need access to A2's model, however please notice A2 is protected class.
class myClassA2 extends Jsonable
{
protected $myClassA2;
function __construct() {
parent::__construct();
$CI =& get_instance();
$CI->load->model("myClassA1")
$this->myClassA1->getWhatINeed();
I also tried the construct and the $this->load('model')
but I would always get load() on null
.
Here is the error message:
PHP Call to protected (from another model)::__construct() from context
Here is the question: Any way around this and use A2 protected method without changing A2 class from protected?