Link: http://www.typo3-jack.net/typo3-dev-lists-netfielders-de/3076-typo3-dev-typolink-anchor.html
getTypoLink() doesn't allow you to pass an anchor parameter. So, in order to add an anchor to such a link you just have to add the anchor part to the id parameter:
$this->cObj->getTypoLink('Link Label', '123#myanchor');
$this->cObj->pi_linkToPage('Link Label', '123#myanchor');
$this->cObj->getTypoLink_URL('123#myanchor');
By the way, ever saw what the harmless function class.tslib_content.php:typoLink() does? Have a look just for fun, it's a 300 liner! Feels like Typo3 has a damned considerable amount of workarounds for various special cases and requirements.