File size: 783B
<?php
namespace MMO\Hide\Repository;
use XF\Finder\UserGroupFinder;
use XF\Mvc\Entity\Finder;
use XF\Mvc\Entity\Repository;
class UserGroup extends Repository
{
/**
* @return Finder
*/
public function findUserGroupsForList(): Finder
{
$defaultSort = $this->options()->mhUserGroupsDefaultSortOrder;
return $this->finder(UserGroupFinder::class)
->where('user_group_id', $this->options()->mhHideUserGroups)
->order($defaultSort['order'], $defaultSort['direction']);
}
/**
* @return array|\XF\Mvc\Entity\ArrayCollection
*/
public function getUserGroupTitlePairs()
{
return $this->findUserGroupsForList()->fetch()->pluckNamed('title', 'user_group_id');
}
}