code: public function flipStringTable(array $stringTable)
      {
          // Return value
          $returnValue = [];
  
          // Loop through stringtable and add flipped items to $returnValue
          foreach ($stringTable as $key => $value) {
              if (!$value instanceof RichText) {
                  $returnValue[$value] = $key;
              } elseif ($value instanceof RichText) {
                  $returnValue[$value->getHashCode()] = $key;
              }
          }
  
          return $returnValue;
      }
docs: Flip string table (for index searching).
  
  @param array $stringTable Stringtable
  
  @return array