OAIDAO::getSetJournalSectionId PHP Method

getSetJournalSectionId() public method

Return the journal ID and section ID corresponding to a journal/section pairing.
public getSetJournalSectionId ( $journalSpec, $sectionSpec, $restrictJournalId = null ) : array
$journalSpec string
$sectionSpec string
$restrictJournalId int
return array (int, int)
    function getSetJournalSectionId($journalSpec, $sectionSpec, $restrictJournalId = null)
    {
        $journal =& $this->journalDao->getByPath($journalSpec);
        if (!isset($journal) || isset($restrictJournalId) && $journal->getId() != $restrictJournalId) {
            return array(0, 0);
        }
        $journalId = $journal->getId();
        $sectionId = null;
        if (isset($sectionSpec)) {
            $section = $this->sectionDao->getByAbbrev($sectionSpec, $journal->getId());
            if (isset($section)) {
                $sectionId = $section->getId();
            } else {
                $sectionId = 0;
            }
        }
        return array($journalId, $sectionId);
    }