Newscoop\Services\ThemesService::findByIssueAndOutput PHP Method

findByIssueAndOutput() public method

Finds output for issue by issue and output
public findByIssueAndOutput ( Issue $issue, Output $output ) : string | null
$issue Newscoop\Entity\Issue Issue object
$output Newscoop\Entity\Output Output object
return string | null
    public function findByIssueAndOutput($issue, $output)
    {
        $outputId = $output;
        if ($output instanceof Output) {
            $outputId = $output->getId();
        }
        $issueId = $issue;
        if ($issue instanceof Issue) {
            $issueId = $issue->getId();
        }
        $resources = $this->em->getRepository('Newscoop\\Entity\\Output\\OutputSettingsIssue')->findBy(array('issue' => $issueId, 'output' => $outputId));
        if (!empty($resources)) {
            return $resources[0];
        }
        return null;
    }