original_string: public function getIcon()
      {
          $ini = eZINI::instance( 'eztags.ini' );
          /** @var array $iconMap */
          $iconMap = $ini->variable( 'Icons', 'IconMap' );
          $defaultIcon = $ini->variable( 'Icons', 'Default' );
  
          if ( $this->attribute( 'main_tag_id' ) > 0 )
              $tag = $this->getMainTag( true );
          else
              $tag = $this;
  
          $tagID = $tag->attribute( 'id' );
          if ( array_key_exists( $tagID, $iconMap ) && !empty( $iconMap[$tagID] ) )
              return $iconMap[$tagID];
  
          /** @var eZTagsObject[] $path */
          $path = $tag->getPath( true, true );
          if ( is_array( $path ) && !empty( $path ) )
          {
              foreach ( $path as $pathElement )
              {
                  $pathElementID = $pathElement->attribute( 'id' );
                  if ( array_key_exists( $pathElementID, $iconMap ) && !empty( $iconMap[$pathElementID] ) )
                      return $iconMap[$pathElementID];
              }
          }
  
          return $defaultIcon;
      }
code: public function getIcon()
      {
          $ini = eZINI::instance( 'eztags.ini' );
          /** @var array $iconMap */
          $iconMap = $ini->variable( 'Icons', 'IconMap' );
          $defaultIcon = $ini->variable( 'Icons', 'Default' );
  
          if ( $this->attribute( 'main_tag_id' ) > 0 )
              $tag = $this->getMainTag( true );
          else
              $tag = $this;
  
          $tagID = $tag->attribute( 'id' );
          if ( array_key_exists( $tagID, $iconMap ) && !empty( $iconMap[$tagID] ) )
              return $iconMap[$tagID];
  
          /** @var eZTagsObject[] $path */
          $path = $tag->getPath( true, true );
          if ( is_array( $path ) && !empty( $path ) )
          {
              foreach ( $path as $pathElement )
              {
                  $pathElementID = $pathElement->attribute( 'id' );
                  if ( array_key_exists( $pathElementID, $iconMap ) && !empty( $iconMap[$pathElementID] ) )
                      return $iconMap[$pathElementID];
              }
          }
  
          return $defaultIcon;
      }
code_tokens: public function getIcon ( ) { $ ini = eZINI :: instance ( 'eztags.ini' ) ; /** @var array $iconMap */ $ iconMap = $ ini -> variable ( 'Icons' , 'IconMap' ) ; $ defaultIcon = $ ini -> variable ( 'Icons' , 'Default' ) ; if ( $ this -> attribute ( 'main_tag_id' ) > 0 ) $ tag = $ this -> getMainTag ( true ) ; else $ tag = $ this ; $ tagID = $ tag -> attribute ( 'id' ) ; if ( array_key_exists ( $ tagID , $ iconMap ) && ! empty ( $ iconMap [ $ tagID ] ) ) return $ iconMap [ $ tagID ] ; /** @var eZTagsObject[] $path */ $ path = $ tag -> getPath ( true , true ) ; if ( is_array ( $ path ) && ! empty ( $ path ) ) { foreach ( $ path as $ pathElement ) { $ pathElementID = $ pathElement -> attribute ( 'id' ) ; if ( array_key_exists ( $ pathElementID , $ iconMap ) && ! empty ( $ iconMap [ $ pathElementID ] ) ) return $ iconMap [ $ pathElementID ] ; } } return $ defaultIcon ; }
docstring: Returns icon associated with the tag, while respecting hierarchy structure
  
  @return string
docstring_tokens: Returns icon associated with the tag while respecting hierarchy structure