getId() public method

Get id
public getId ( ) : integer
return integer
コード例 #1
0
ファイル: SitemapListener.php プロジェクト: beyzakokcan/ojs
 /**
  * @param SitemapPopulateEvent $event
  * @param Issue $issue
  * @return SitemapPopulateEvent
  */
 private function generateArticleLinks(SitemapPopulateEvent $event, Issue $issue)
 {
     $articles = $issue->getArticles();
     $journal = $issue->getJournal();
     foreach ($articles as $article) {
         $event->getGenerator()->addUrl(new UrlConcrete($this->router->generate('ojs_article_page', ['publisher' => $journal->getPublisher()->getSlug(), 'slug' => $journal->getSlug(), 'issue_id' => $issue->getId(), 'article_id' => $article->getId()], true), new \DateTime(), UrlConcrete::CHANGEFREQ_WEEKLY, 1), 'journals-' . $journal->getSlug());
     }
     return $event;
 }
コード例 #2
0
ファイル: IssueController.php プロジェクト: ojs/ojs
 /**
  * @param Issue $issue
  * @return ArrayCollection
  */
 private function setupIssueSections(Issue $issue)
 {
     $sections = [];
     foreach ($issue->getJournal()->getSections() as $section) {
         $sectionHaveIssueArticle = false;
         foreach ($section->getArticles() as $article) {
             if ($article->getIssue() !== null) {
                 if ($article->getIssue()->getId() == $issue->getId()) {
                     $sectionHaveIssueArticle = true;
                 }
             }
         }
         if ($sectionHaveIssueArticle) {
             $sections[] = $section;
         }
     }
     //order sections by section order
     uasort($sections, function ($a, $b) {
         return (int) $a->getSectionOrder() > (int) $b->getSectionOrder() ? 1 : -1;
     });
     return $sections;
 }
コード例 #3
0
 /**
  * Get article list by issue_id with orderNum attribute ordered
  * @param  Issue $issue
  * @param  bool $asc
  * @param  int $status default 3 (published)  see Ojs\Common\CommonParams
  * @return Article[]
  */
 public function getOrderedArticlesByIssue(Issue $issue, $asc = false, $status = 3)
 {
     $q = $this->createQueryBuilder('a')->select('a')->where('a.issueId = :issue_id AND a.status = :status')->orderBy('a.orderNum', $asc ? 'ASC' : 'DESC')->setParameter('issue_id', $issue->getId())->setParameter('status', $status)->getQuery();
     $articles = $q->getResult();
     return $articles;
 }