I am trying to create dynimic model class with a model function inside the user model, however for some reason it unable to identify the class location. it gives me an error
Fatal error: Class 'VarEducation' not found
public function partner()
{
$view_service=new ViewService();
$partner_vars_check=$view_service->getUserVarPartnerModelCheckMappingArray();
foreach($partner_vars_check as $partner_key=>$partner_var){
$table= str_replace("p_","var_",$partner_key);
$sql = "SELECT * FROM ".$table."
WHERE id='" . $this->{$partner_key} . "'
ORDER BY id DESC";
$partner_obj = new $partner_var();
$this->{$partner_key} = new \Phalcon\Mvc\Model\Resultset\Simple(null, $partner_obj,
$partner_obj->getReadConnection()->query($sql));
}
Any idea on what causing this ? i suspect the namespace but this dynamic models all are inthat model name space.