Contao\MemberGroupModel::findFirstActiveWithJumpToByIds PHP Метод

findFirstActiveWithJumpToByIds() публичный статический Метод

Find the first active group with a published jumpTo page
Устаревший: Deprecated since Contao 4.0, to be removed in Contao 5.0. Use PageModel::findFirstActiveByMemberGroups() instead.
public static findFirstActiveWithJumpToByIds ( string $arrIds ) : MemberGroupModel | null
$arrIds string An array of member group IDs
Результат MemberGroupModel | null The model or null if there is no matching member group
    public static function findFirstActiveWithJumpToByIds($arrIds)
    {
        @trigger_error('Using MemberGroupModel::findFirstActiveWithJumpToByIds() has been deprecated and will no longer work in Contao 5.0. Use PageModel::findFirstActiveByMemberGroups() instead.', E_USER_DEPRECATED);
        if (!is_array($arrIds) || empty($arrIds)) {
            return null;
        }
        $time = \Date::floorToMinute();
        $objDatabase = \Database::getInstance();
        $arrIds = array_map('intval', $arrIds);
        $objResult = $objDatabase->prepare("SELECT p.* FROM tl_member_group g LEFT JOIN tl_page p ON g.jumpTo=p.id WHERE g.id IN(" . implode(',', $arrIds) . ") AND g.jumpTo>0 AND g.redirect='1' AND g.disable!='1' AND (g.start='' OR g.start<='{$time}') AND (g.stop='' OR g.stop>'" . ($time + 60) . "') AND p.published='1' AND (p.start='' OR p.start<='{$time}') AND (p.stop='' OR p.stop>'" . ($time + 60) . "') ORDER BY " . $objDatabase->findInSet('g.id', $arrIds))->limit(1)->execute();
        if ($objResult->numRows < 1) {
            return null;
        }
        return new static($objResult);
    }