<?php

namespace KupShop\CommentsBundle\Admin\lists;

use KupShop\CommentsBundle\Comment;
use Query\Operator;

class ArticlesCommentsList extends CommentsList
{
    protected static $type = Comment::TYPE_ARTICLE;

    public function getQuery()
    {
        $qb = parent::getQuery();

        if ($articles = getVal('articles')) {
            $qb->andWhere(Operator::inIntArray($articles, 'c.id_article'));
        }

        return $qb;
    }
}

return ArticlesCommentsList::class;
