original_string: public function getLocations($orgId = null)
      {
          // Make sure no invalid data gets through
          $orgId = intval($orgId);
  
          $cacheId = __CLASS__ . '_' . __FUNCTION__ . '_' . $orgId;
  
          if ($results = $this->cache->load($cacheId)) {
              return $results;
          }
  
          $select = $this->db->select();
          $select->from('gems__locations', array('glo_id_location', 'glo_name'))
                  ->order('glo_name');
  
          if ($orgId) {
              // Check only for active when with $orgId: those are usually used
              // with editing, while the whole list is used for display.
              $select->where('glo_active = 1');
              $select->where("glo_organizations LIKE '%:$orgId:%'");
          }
  
          $results = $this->db->fetchPairs($select);
          $this->cache->save($results, $cacheId, array('locations'));
          return $results;
      }
code: public function getLocations($orgId = null)
      {
          // Make sure no invalid data gets through
          $orgId = intval($orgId);
  
          $cacheId = __CLASS__ . '_' . __FUNCTION__ . '_' . $orgId;
  
          if ($results = $this->cache->load($cacheId)) {
              return $results;
          }
  
          $select = $this->db->select();
          $select->from('gems__locations', array('glo_id_location', 'glo_name'))
                  ->order('glo_name');
  
          if ($orgId) {
              // Check only for active when with $orgId: those are usually used
              // with editing, while the whole list is used for display.
              $select->where('glo_active = 1');
              $select->where("glo_organizations LIKE '%:$orgId:%'");
          }
  
          $results = $this->db->fetchPairs($select);
          $this->cache->save($results, $cacheId, array('locations'));
          return $results;
      }
code_tokens: public function getLocations ( $ orgId = null ) { // Make sure no invalid data gets through $ orgId = intval ( $ orgId ) ; $ cacheId = __CLASS__ . '_' . __FUNCTION__ . '_' . $ orgId ; if ( $ results = $ this -> cache -> load ( $ cacheId ) ) { return $ results ; } $ select = $ this -> db -> select ( ) ; $ select -> from ( 'gems__locations' , array ( 'glo_id_location' , 'glo_name' ) ) -> order ( 'glo_name' ) ; if ( $ orgId ) { // Check only for active when with $orgId: those are usually used // with editing, while the whole list is used for display. $ select -> where ( 'glo_active = 1' ) ; $ select -> where ( "glo_organizations LIKE '%:$orgId:%'" ) ; } $ results = $ this -> db -> fetchPairs ( $ select ) ; $ this -> cache -> save ( $ results , $ cacheId , array ( 'locations' ) ) ; return $ results ; }
docstring: Returns an array with identical key => value pairs containing care provision locations.
  
  @param int $orgId Optional to slect for single organization
  @return array
docstring_tokens: Returns an array with identical key = > value pairs containing care provision locations .