TopCommentsQuery.php 1.31 KB
<?php

namespace FootyRoom\Queries\Comment;

/**
 * Query to return top comments in a discussion.
 */
class TopCommentsQuery implements WithUserQuery
{
    use ViewedBy;
    use WithUser;

    /**
     * @var string
     */
    protected $discussionId;

    /**
     * @var string
     */
    protected $filter;

    /**
     * Optional comment meta keys to return.
     *
     * @var string[]
     */
    protected $meta = [];

    /**
     * Constructor.
     *
     * @param string $discussionId
     */
    public function __construct($discussionId)
    {
        $this->discussionId = $discussionId;
    }

    /**
     * Gets the value of discussionId.
     *
     * @return string
     */
    public function getDiscussionId()
    {
        return $this->discussionId;
    }

    /**
     * Gets the value of filter.
     *
     * @return string
     */
    public function getFilter()
    {
        return $this->filter;
    }

    /**
     * Sets the value of filter.
     *
     * @param string $filter the filter
     *
     * @return self
     */
    public function filter($filter)
    {
        $this->filter = $filter;

        return $this;
    }

    /**
     * Gets the Optional comment meta keys to return.
     *
     * @return string[]
     */
    public function getMeta()
    {
        return $this->meta;
    }
}