public function findBySectionAndOutput($section, $output)
{
/** Get the id if an Output object is supplied */
/* @var $output Output */
$outputId = $output;
if ($output instanceof Output) {
$outputId = $output->getId();
}
/** Get the id if an Section object is supplied */
/* @var $section Section */
$sectionId = $section;
if ($section instanceof Section) {
$sectionId = $section->getId();
}
$em = $this->getManager();
$repository = $em->getRepository($this->entityClassName);
$resources = $repository->findBy(array('section' => $sectionId, 'output' => $outputId));
if (!empty($resources)) {
return $resources[0];
}
return NULL;
}