0

I am using HMVC codeigniter 3. I have a folder called admin under and in that folder I have a subfolder called client. In my config file, i have set up the module path like this;

$config['modules_locations'] = array(
    APPPATH.'modules/'                   => '../modules/',
    APPPATH.'modules/admin/' => '../modules/admin/', 
);

Now, the problem is, its loadig my client controller but its not loading my entites. it is showing me the following error;

> An uncaught Exception was encountered
> 
> Type: Doctrine\ORM\Query\QueryException
> 
> Message: [Semantical Error] line 0, col 109 near 'entities\AppClient':
> Error: Class 'entities\AppClient' is not defined.

Please help me to solve this issue..This client module works fine, if i moved it from sub module to only modules folder

Pradeep
  • 9,667
  • 13
  • 27
  • 34
surma
  • 97
  • 1
  • 9

1 Answers1

0

solved it...Add the following function in doctorine.php

private function _recursiveDir(&$array, $directory)
    {
        $scanned_dir = array_diff(scandir($directory), array('..', '.'));
        sort($scanned_dir);

        $subModules = array(
            "admin"
        );

        foreach ($scanned_dir as $module) {
            if (is_dir($directory.$module."/models")) {
                $array[] = $directory.$module."/models/doctrine/entities";
            } else if (in_array($module, $subModules)) {
                $this->_recursiveDir($array, $directory.$module."/");
            }
        }
    }
surma
  • 97
  • 1
  • 9