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?