<?php

/**
 *
 * @see Waindigo_SocialGroups_ControllerPublic_SocialForum
 */
class Waindigo_LastPostAvatar_Extend_Waindigo_SocialGroups_ControllerPublic_SocialForum extends XFCP_Waindigo_LastPostAvatar_Extend_Waindigo_SocialGroups_ControllerPublic_SocialForum
{

    /**
     *
     * @see Waindigo_SocialGroups_ControllerPublic_SocialForum::_getThreadFetchElements()
     */
    protected function _getThreadFetchElements(array $forum, array $displayConditions)
    {
        /* @var $threadModel XenForo_Model_Thread */
        $threadModel = $this->_getThreadModel();

        $threadFetchElements = parent::_getThreadFetchElements($forum, $displayConditions);

        $threadFetchConditions = $threadFetchElements['conditions'];
        $threadFetchOptions = $threadFetchElements['options'];

        if (isset($threadFetchOptions['join_waindigo'])) {
            $threadFetchOptions['join_waindigo'] |= Waindigo_LastPostAvatar_Extend_XenForo_Model_Thread::FETCH_WAINDIGO_LASTPOST_AVATAR;
        } else {
            $threadFetchOptions['join_waindigo'] = Waindigo_LastPostAvatar_Extend_XenForo_Model_Thread::FETCH_WAINDIGO_LASTPOST_AVATAR;
        }

        return array(
            'conditions' => $threadFetchConditions,
            'options' => $threadFetchOptions
        );
    } /* END _getThreadFetchElements */
}