Newscoop\Entity\Repository\CommentRepository::setIndexedNow PHP 메소드

setIndexedNow() 공개 메소드

Set indexed now
public setIndexedNow ( array $comments ) : void
$comments array
리턴 void
    public function setIndexedNow(array $comments)
    {
        if (empty($comments)) {
            return;
        }
        $this->getEntityManager()->createQuery('UPDATE Newscoop\\Entity\\Comment c SET c.indexed = CURRENT_TIMESTAMP() WHERE c.id IN (:comments)')->setParameter('comments', array_map(function ($comment) {
            return $comment->getId();
        }, $comments))->execute();
    }