getNumerator() public method

public getNumerator ( ) : integer
return integer
Beispiel #1
0
 public static function numerateIssue(Issue $issue, ObjectManager $entityManager)
 {
     $journal = $issue->getJournal();
     if ($issue->getNumerator() === null) {
         try {
             $numerator = $entityManager->getRepository('OjsJournalBundle:Numerator')->getIssueNumerator($journal);
             $last = $numerator->getLast() + 1;
             $numerator->setLast($last);
             $issue->setNumerator($last);
         } catch (NoResultException $exception) {
             $numerator = new Numerator();
             $numerator->setJournal($journal);
             $numerator->setType('issue');
             $numerator->setLast(1);
             $issue->setNumerator(1);
         }
         $entityManager->persist($issue);
         $entityManager->persist($numerator);
         $entityManager->flush();
     }
 }