getId() public method

Getter for id
public getId ( ) : integer
return integer
コード例 #1
0
 public function getId()
 {
     if ($this->__isInitialized__ === false) {
         return (int) $this->_identifier["id"];
     }
     $this->__load();
     return parent::getId();
 }
コード例 #2
0
 /**
  * Remove author with type from article
  *
  * @param Article       $article
  * @param Author        $author
  * @param ArticleAuthor $authorType
  *
  * @return ArticleAuthor
  */
 public function removeAuthorFromArticle(Article $article, Author $author, AuthorType $authorType)
 {
     $articleAuthor = $this->em->getRepository('Newscoop\\Entity\\ArticleAuthor')->getArticleAuthor($article->getNumber(), $article->getLanguageCode(), $author->getId(), $authorType->getId())->getOneOrNullResult();
     if (!$articleAuthor) {
         throw new ResourcesConflictException("Author with this type is not attached to article", 409);
     }
     $this->em->remove($articleAuthor);
     $this->em->flush();
     $articleAuthors = $this->em->getRepository('Newscoop\\Entity\\ArticleAuthor')->getArticleAuthors($article->getNumber(), $article->getLanguageCode())->getResult();
     $this->reorderAuthors($this->em, $articleAuthors);
 }
コード例 #3
0
ファイル: User.php プロジェクト: nidzix/Newscoop
 /**
  * Get author id
  *
  * @return int
  */
 public function getAuthorId()
 {
     return $this->author ? $this->author->getId() : null;
 }
コード例 #4
0
 /**
  * Get Comments for all authors articles grouped by day
  *
  * @param \Newscoop\Entity\Author   $author
  * @param string $range
  *
  * @return Doctrine\ORM\Query
  */
 public function getCommentsForAuthorArticlesPerDay($author, $range = '-60 days')
 {
     $qb = $this->createQueryBuilder('c');
     $date = new \DateTime();
     $date->modify($range);
     $qb->select('COUNT(c.id) as number', "DATE_FORMAT(c.time_created, '%Y-%m-%d') as date")->leftJoin('c.article', 'a')->leftJoin('a.authors', 'aa')->andwhere('aa.id = :authorId')->andWhere('c.time_created > :date')->setParameter('authorId', $author->getId())->setParameter('date', $date)->groupBy('date');
     return $qb->getQuery();
 }