Newscoop\Service\Implementation\OutputSettingSectionServiceDoctrine::findBySection PHP Method

findBySection() public method

Provides the Output Settings that has the provided Section.
public findBySection ( Section | integer $section ) : Newscoop\Entity\OutputSettingsSection
$section Newscoop\Entity\Section | integer The section to be searched, not null, not empty.
return Newscoop\Entity\OutputSettingsSection The Output Setting, empty array if no Output Setting could be found for the provided section.
    public function findBySection($section)
    {
        if ($section instanceof Section) {
            $section = $section->getId();
        }
        $em = $this->getManager();
        $repository = $em->getRepository($this->entityClassName);
        $resources = $repository->findBySection($section);
        if (isset($resources) && count($resources) > 0) {
            return $resources;
        }
        return array();
    }