library/Haste/Model/UserModel.php
public static function findActiveByGroups(array $arrGroups, array $arrOptions = [])
    {
        if (empty($arrGroups))
        {
            return null;
        }

        $t    = static::$strTable;
        $time = \Date::floorToMinute();

        $arrColumns = ["($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "') AND $t.disable=''"];

        if (!empty(array_filter($arrGroups)))
        {
            $arrColumns[] = QueryHelper::createWhereForSerializedBlob('groups', array_filter($arrGroups));
        }

        return static::findBy($arrColumns, null, $arrOptions);
    }
public static function findActiveByGroups(array $arrGroups, array $arrOptions = [])
    {
        if (empty($arrGroups))
        {
            return null;
        }

        $t    = static::$strTable;
        $time = \Date::floorToMinute();

        $arrColumns = ["($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "') AND $t.disable=''"];

        if (!empty(array_filter($arrGroups)))
        {
            $arrColumns[] = QueryHelper::createWhereForSerializedBlob('groups', array_filter($arrGroups));
        }

        return static::findBy($arrColumns, null, $arrOptions);
    }
public static function findActiveByGroups ( array $ arrGroups , array $ arrOptions = [ ] ) { if ( empty ( $ arrGroups ) ) { return null ; } $ t = static :: $ strTable ; $ time = \ Date :: floorToMinute ( ) ; $ arrColumns = [ "($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ( $ time + 60 ) . "') AND $t.disable=''" ] ; if ( ! empty ( array_filter ( $ arrGroups ) ) ) { $ arrColumns [ ] = QueryHelper :: createWhereForSerializedBlob ( 'groups' , array_filter ( $ arrGroups ) ) ; } return static :: findBy ( $ arrColumns , null , $ arrOptions ) ; }
Find active users by given user groups

@param array $arrGroups
@param array $arrOptions

@return \UserModel|\UserModel[]|\Model\Collection|null
Find active users by given user groups