code: public function showRelatedRecords($data, $row)
  	{
  		Contao\System::loadLanguageFile('tl_opt_in_related');
  		Contao\Controller::loadDataContainer('tl_opt_in_related');
  
  		$objRelated = $this->Database->prepare("SELECT * FROM tl_opt_in_related WHERE pid=?")
  									 ->execute($row['id']);
  
  		while ($objRelated->next())
  		{
  			$arrAdd = array();
  			$arrRow = $objRelated->row();
  
  			foreach ($arrRow as $k=>$v)
  			{
  				$label = \is_array($GLOBALS['TL_DCA']['tl_opt_in_related']['fields'][$k]['label']) ? $GLOBALS['TL_DCA']['tl_opt_in_related']['fields'][$k]['label'][0] : $GLOBALS['TL_DCA']['tl_opt_in_related']['fields'][$k]['label'];
  
  				$arrAdd[$label] = $v;
  			}
  
  			$data['tl_opt_in_related'][] = $arrAdd;
  		}
  
  		return $data;
  	}
docs: Show the related records
  
  @param array $data
  @param array $arrRow