We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

INNER JOINS model could not be loaded

Been having an issue with INNER JOINS.

model head:


namespace Models;

use Phalcon\Mvc\Model;
use Phalcon\Mvc\Model\Message;
use Phalcon\Filter;

use Models\Clients\Users;
use Models\Devices\devManage;
use Models\Devices\devInvManage;

Function that is causing the error


public function isDevice($deviceID)
    {
            //$device = new devManage();

            //add a new filter
            $filter = new Filter();

            $devSan = $filter->sanitize($deviceID, "alphanum");

            $manDev = devManage::findFirst("devID = '".$devSan."'");

            foreach($manDev as $items){

                echo "found these:".$items->devID;

                $isDevice = $mandev->devInvManage->devID;

            }

        if ($isDevice == ""){

            http_response_code(409);

            $error_notify = array(
            "status" => "ERROR",
            "message" => "No record was found. Please check the data you submitted.",

            );

            echo json_encode($error_notify , JSON_PRETTY_PRINT);

            exit();

        }else{

            return $isDevice;   

        }

    }

This results in an error:


Model devInvManage could not be loaded. 

I have checked all the paths and made sure that the namespace is correct. devManage loads up just fine but I cannot access the model for the inner join.

any ideas?

edited Jun '15
use Models\Devices\devInvManage;

in devManage model I needed to add that bit of code.

Was able to reference the model.