MonographDAO::categoryAssociationExists PHP Method

categoryAssociationExists() public method

Check if an monograph exists with the specified ID.
public categoryAssociationExists ( $monographId, $categoryId ) : boolean
$monographId int
return boolean
    function categoryAssociationExists($monographId, $categoryId)
    {
        $result = $this->retrieve('SELECT COUNT(*) FROM submission_categories WHERE submission_id = ? AND category_id = ?', array((int) $monographId, (int) $categoryId));
        $returner = isset($result->fields[0]) && $result->fields[0] == 1 ? true : false;
        $result->Close();
        return $returner;
    }