getIssueId() public method

Get ID of the issue this article is in.
public getIssueId ( ) : integer
return integer
Ejemplo n.º 1
0
 /**
  * @covers PubObjectCache
  */
 public function testAddGalley()
 {
     $nullVar = null;
     $cache = new PubObjectCache();
     $article = new PublishedArticle();
     $article->setId('2');
     $article->setIssueId('1');
     $articleGalley = new ArticleGalley();
     $articleGalley->setId('3');
     $articleGalley->setArticleId($article->getId());
     self::assertFalse($cache->isCached('galleys', $articleGalley->getId()));
     self::assertFalse($cache->isCached('galleysByArticle', $article->getId()));
     self::assertFalse($cache->isCached('galleysByArticle', $article->getId(), $articleGalley->getId()));
     self::assertFalse($cache->isCached('galleysByIssue', $article->getIssueId()));
     self::assertFalse($cache->isCached('galleysByIssue', $article->getIssueId(), $articleGalley->getId()));
     $cache->add($articleGalley, $article);
     self::assertTrue($cache->isCached('galleys', $articleGalley->getId()));
     self::assertFalse($cache->isCached('galleysByArticle', $article->getId()));
     self::assertTrue($cache->isCached('galleysByArticle', $article->getId(), $articleGalley->getId()));
     self::assertFalse($cache->isCached('galleysByIssue', $article->getIssueId()));
     self::assertTrue($cache->isCached('galleysByIssue', $article->getIssueId(), $articleGalley->getId()));
     $retrievedArticleGalley1 = $cache->get('galleys', $articleGalley->getId());
     self::assertEquals($articleGalley, $retrievedArticleGalley1);
     $retrievedArticleGalley2 = $cache->get('galleysByIssue', $article->getIssueId(), $articleGalley->getId());
     self::assertEquals($retrievedArticleGalley1, $retrievedArticleGalley2);
     $cache->markComplete('galleysByArticle', $article->getId());
     self::assertTrue($cache->isCached('galleysByArticle', $article->getId()));
     self::assertFalse($cache->isCached('galleysByIssue', $article->getIssueId()));
 }