public function findByIssueAndOutput($issue, $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 Issue object is supplied */
/* @var $issue Issue */
$issueId = $issue;
if ($issue instanceof Issue) {
$issueId = $issue->getId();
}
$em = $this->getManager();
$repository = $em->getRepository($this->entityClassName);
$resources = $repository->findBy(array('issue' => $issueId, 'output' => $outputId));
if (!empty($resources)) {
return $resources[0];
}
return NULL;
}