<?php
namespace MNM\Spitzner\Plugin;

class ChangeFaqCollection
{
    /**
     * @param \Mageprince\Faq\Block\Index\Index $subject
     * @param \Mageprince\Faq\Model\ResourceModel\Faq\Collection $result
     * @param $group
     * @return \Mageprince\Faq\Model\ResourceModel\Faq\Collection
     */
    public function afterGetFaqCollection(\Mageprince\Faq\Block\Index\Index $subject, \Mageprince\Faq\Model\ResourceModel\Faq\Collection $result, $group)
    {
        $result->addFieldToFilter('group', ['eq' => intval($group)]);
        $result->setOrder('title', 'ASC');

        return $result;
    }
}