protected function getDummyComp() { // insure we only get this once if (!CostbenefitprojectionHelper::checkArray($this->dummyComp)) { // Create a new query object. $query = $this->db->getQuery(true); // Get from #__costbenefitprojection_service_provider as a $query->select($this->db->quoteName(array('a.testcompanies'), array('testcompanies'))); $query->from($this->db->quoteName('#__costbenefitprojection_service_provider', 'a')); // load the query $this->db->setQuery($query); $this->db->execute(); if ($this->db->getNumRows()) { // get the test companies $testcompanies = $this->db->loadColumn(); // global Ids $global = array(); // okay now we loop the test companies to build a global id set foreach ($testcompanies as $json) { if (CostbenefitprojectionHelper::checkJson($json)) { $global = array_merge($global, json_decode($json, true)); } } // now insure the ids are unique $this->dummyComp = array_unique($global); } } return $this->dummyComp; }