I am trying this code in my module but getting error
jimport('joomla.application.component.model');
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_idlmessaging/models','IdlmessagingModel');
$questionmodel = JModelLegacy::getInstance('Question', 'IdlmessagingModel');
$questionid = '2'; //We used here '1' article id
$question= $questionmodel->getData($questionid );
Error: "Call to a member function getData on boolean"