Newscoop\Service\Implementation\OutputSettingSectionServiceDoctrine::findBySection PHP 메소드

findBySection() 공개 메소드

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.
리턴 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();
    }