public function getUrlsForSocial($idSite, $period, $date, $segment = false, $idSubtable = false)
{
$dataTable = $this->getDataTable(Archiver::WEBSITES_RECORD_NAME, $idSite, $period, $date, $segment, $expanded = true);
// get the social network domain referred to by $idSubtable
$socialNetworks = Social::getInstance()->getDefinitions();
$social = false;
if ($idSubtable !== false) {
--$idSubtable;
reset($socialNetworks);
for ($i = 0; $i != (int) $idSubtable; ++$i) {
next($socialNetworks);
}
$social = current($socialNetworks);
}
// filter out everything but social network indicated by $idSubtable
$dataTable->filter('ColumnCallbackDeleteRow', array('label', function ($url) use($social) {
return !Social::getInstance()->isSocialUrl($url, $social);
}));
// merge the datatable's subtables which contain the individual URLs
$dataTable = $dataTable->mergeSubtables();
$dataTable->filter('AddSegmentByLabel', array('referrerUrl'));
$dataTable->filter('Piwik\\Plugins\\Referrers\\DataTable\\Filter\\UrlsForSocial', array($expanded));
return $dataTable;
}