core-bundle/src/Resources/contao/dca/tl_opt_in.php
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;
	}
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;
	}
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 ; }
Show the related records

@param array $data
@param array $arrRow
Show the related records