i'm using Joomla! 2.5 and i'm trying to pass a variable from a public function to a protected function inside the same class but something I'm doing wrong. Any idea what is it?
public function getJobsType() {
$jobsquery = $db->getQuery(true);
// Select the records for the connected user
$jobsquery = "SELECT jobassigned FROM #__jobs_userac WHERE user =".$userId;
$db->setQuery($jobsquery);
$row = $db->loadRowList();
// I have one row per user so it returns only one field
$job_id = $row['0']['0'];
return $job_id;}
protected function getListQuery() {
//If i set the variable values my self the query is working
// ex. $job_id ="1,2,3";
$db = $this->getDbo();
$query = $db->getQuery(true);
$query ->select($this->getState('list.select', 'DISTINCT a.*'));
$query->from('`#__jobs_data` AS a');
// I want to pass the values from the getJobsType() here
$query->where('type IN ('.$job_id.')');
................
Thanks in advance for any help you are able to provide.