Newscoop\Entity\Repository\CommentRepository::setIndexedNow PHP Method

setIndexedNow() public method

Set indexed now
public setIndexedNow ( array $comments ) : void
$comments array
return 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();
    }