public function getThemePublication($theme, $output = null)
{
$pathRsc = $this->getSyncResourceService()->getThemePath($theme->getPath());
$em = $this->getManager();
$qb = $em->createQueryBuilder();
$qb->select('th')->from(OutputSettingsTheme::NAME, 'th');
$qb->where('th.themePath = :themePath');
$qb->setParameter('themePath', $pathRsc);
if (!is_null($output)) {
$qb->andWhere('th.output = :output');
$qb->setParameter('output', $output);
}
$result = current($qb->getQuery()->getResult());
if ($result) {
return $result->getPublication();
}
return null;
}