public function getMods()
    {
        $mods = Podium::getInstance()->podiumCache->getElement('forum.moderators', $this->id);
        if ($mods === false) {
            $mods = [];
            $modteam = User::find()->select(['id', 'role'])->where([
                    'status' => User::STATUS_ACTIVE,
                    'role' => [User::ROLE_ADMIN, User::ROLE_MODERATOR]
                ]);
            foreach ($modteam->each() as $user) {
                if ($user->role == User::ROLE_ADMIN) {
                    $mods[] = $user->id;
                    continue;
                }
                if ((new Query())->from(Mod::tableName())->where([
                        'forum_id' => $this->id, 'user_id' => $user->id
                    ])->exists()) {
                    $mods[] = $user->id;
                }
            }
            Podium::getInstance()->podiumCache->setElement('forum.moderators', $this->id, $mods);
        }
        return $mods;
    }
public function getMods()
    {
        $mods = Podium::getInstance()->podiumCache->getElement('forum.moderators', $this->id);
        if ($mods === false) {
            $mods = [];
            $modteam = User::find()->select(['id', 'role'])->where([
                    'status' => User::STATUS_ACTIVE,
                    'role' => [User::ROLE_ADMIN, User::ROLE_MODERATOR]
                ]);
            foreach ($modteam->each() as $user) {
                if ($user->role == User::ROLE_ADMIN) {
                    $mods[] = $user->id;
                    continue;
                }
                if ((new Query())->from(Mod::tableName())->where([
                        'forum_id' => $this->id, 'user_id' => $user->id
                    ])->exists()) {
                    $mods[] = $user->id;
                }
            }
            Podium::getInstance()->podiumCache->setElement('forum.moderators', $this->id, $mods);
        }
        return $mods;
    }
public function getMods ( ) { $ mods = Podium :: getInstance ( ) -> podiumCache -> getElement ( 'forum.moderators' , $ this -> id ) ; if ( $ mods === false ) { $ mods = [ ] ; $ modteam = User :: find ( ) -> select ( [ 'id' , 'role' ] ) -> where ( [ 'status' => User :: STATUS_ACTIVE , 'role' => [ User :: ROLE_ADMIN , User :: ROLE_MODERATOR ] ] ) ; foreach ( $ modteam -> each ( ) as $ user ) { if ( $ user -> role == User :: ROLE_ADMIN ) { $ mods [ ] = $ user -> id ; continue ; } if ( ( new Query ( ) ) -> from ( Mod :: tableName ( ) ) -> where ( [ 'forum_id' => $ this -> id , 'user_id' => $ user -> id ] ) -> exists ( ) ) { $ mods [ ] = $ user -> id ; } } Podium :: getInstance ( ) -> podiumCache -> setElement ( 'forum.moderators' , $ this -> id , $ mods ) ; } return $ mods ; }
Returns list of moderators for this forum.
@return int[]
Returns list of moderators for this forum .