original_string: protected static function get_definitions_for_component($componentname) {
          global $DB;
          list($a, $b) = core_component::normalize_component($componentname);
          $component = $b ? ($a . '_' . $b) : $a;
          $sql = 'component = :component';
          $params = array('component' => $component);
          if ($component === 'core') {
              $sql .= ' OR component LIKE :coreprefix';
              $params['coreprefix'] = 'core_%';
          }
          $fields = $DB->sql_concat_join("':'", array('itemtype', 'component'));
          $existingareas = $DB->get_records_sql(
                  "SELECT $fields AS returnkey, a.* FROM {tag_area} a WHERE $sql", $params);
          $fields = $DB->sql_concat_join("':'", array('name', 'component'));
          $existingcolls = $DB->get_records_sql(
                  "SELECT $fields AS returnkey, t.* FROM {tag_coll} t WHERE $sql", $params);
          return array($existingareas, $existingcolls);
  
      }
code: protected static function get_definitions_for_component($componentname) {
          global $DB;
          list($a, $b) = core_component::normalize_component($componentname);
          $component = $b ? ($a . '_' . $b) : $a;
          $sql = 'component = :component';
          $params = array('component' => $component);
          if ($component === 'core') {
              $sql .= ' OR component LIKE :coreprefix';
              $params['coreprefix'] = 'core_%';
          }
          $fields = $DB->sql_concat_join("':'", array('itemtype', 'component'));
          $existingareas = $DB->get_records_sql(
                  "SELECT $fields AS returnkey, a.* FROM {tag_area} a WHERE $sql", $params);
          $fields = $DB->sql_concat_join("':'", array('name', 'component'));
          $existingcolls = $DB->get_records_sql(
                  "SELECT $fields AS returnkey, t.* FROM {tag_coll} t WHERE $sql", $params);
          return array($existingareas, $existingcolls);
  
      }
code_tokens: protected static function get_definitions_for_component ( $ componentname ) { global $ DB ; list ( $ a , $ b ) = core_component :: normalize_component ( $ componentname ) ; $ component = $ b ? ( $ a . '_' . $ b ) : $ a ; $ sql = 'component = :component' ; $ params = array ( 'component' => $ component ) ; if ( $ component === 'core' ) { $ sql .= ' OR component LIKE :coreprefix' ; $ params [ 'coreprefix' ] = 'core_%' ; } $ fields = $ DB -> sql_concat_join ( "':'" , array ( 'itemtype' , 'component' ) ) ; $ existingareas = $ DB -> get_records_sql ( "SELECT $fields AS returnkey, a.* FROM {tag_area} a WHERE $sql" , $ params ) ; $ fields = $ DB -> sql_concat_join ( "':'" , array ( 'name' , 'component' ) ) ; $ existingcolls = $ DB -> get_records_sql ( "SELECT $fields AS returnkey, t.* FROM {tag_coll} t WHERE $sql" , $ params ) ; return array ( $ existingareas , $ existingcolls ) ; }
docstring: Returns all tag areas and collections that are currently cached in DB for this component
  
  @param string $componentname
  @return array first element is the list of areas and the second list of collections
docstring_tokens: Returns all tag areas and collections that are currently cached in DB for this component