concrete/src/File/Set/Set.php
public static function getMySets($user = false)
    {
        $app = Facade::getFacadeApplication();

        if ($user === false) {
            $user = $app->make(User::class);
        }

        /** @var $database \Concrete\Core\Database\Connection\Connection */
        $database = $app->make('database')->connection();
        $fileSets = array();

        $queryBuilder = $database->createQueryBuilder();
        $results = $queryBuilder->select('*')->from('FileSets')->where(
            $queryBuilder->expr()->eq('fsType', self::TYPE_PUBLIC)
            )->orWhere(
                $queryBuilder->expr()->andX(
                    $queryBuilder->expr()->in('fsType',[self::TYPE_PRIVATE, self::TYPE_STARRED, self::TYPE_PUBLIC]),
                    $queryBuilder->expr()->eq('uID', $user->getUserID())
                )
            )->orderBy('fsName', 'ASC')->execute();


        while ($row = $results->fetch()) {
            $fileSet = new static();
            $fileSet = array_to_object($fileSet, $row);
            $fileSets[] = $fileSet;
        }

        return $fileSets;
    }
public static function getMySets($user = false)
    {
        $app = Facade::getFacadeApplication();

        if ($user === false) {
            $user = $app->make(User::class);
        }

        /** @var $database \Concrete\Core\Database\Connection\Connection */
        $database = $app->make('database')->connection();
        $fileSets = array();

        $queryBuilder = $database->createQueryBuilder();
        $results = $queryBuilder->select('*')->from('FileSets')->where(
            $queryBuilder->expr()->eq('fsType', self::TYPE_PUBLIC)
            )->orWhere(
                $queryBuilder->expr()->andX(
                    $queryBuilder->expr()->in('fsType',[self::TYPE_PRIVATE, self::TYPE_STARRED, self::TYPE_PUBLIC]),
                    $queryBuilder->expr()->eq('uID', $user->getUserID())
                )
            )->orderBy('fsName', 'ASC')->execute();


        while ($row = $results->fetch()) {
            $fileSet = new static();
            $fileSet = array_to_object($fileSet, $row);
            $fileSets[] = $fileSet;
        }

        return $fileSets;
    }
public static function getMySets ( $ user = false ) { $ app = Facade :: getFacadeApplication ( ) ; if ( $ user === false ) { $ user = $ app -> make ( User :: class ) ; } /** @var $database \Concrete\Core\Database\Connection\Connection */ $ database = $ app -> make ( 'database' ) -> connection ( ) ; $ fileSets = array ( ) ; $ queryBuilder = $ database -> createQueryBuilder ( ) ; $ results = $ queryBuilder -> select ( '*' ) -> from ( 'FileSets' ) -> where ( $ queryBuilder -> expr ( ) -> eq ( 'fsType' , self :: TYPE_PUBLIC ) ) -> orWhere ( $ queryBuilder -> expr ( ) -> andX ( $ queryBuilder -> expr ( ) -> in ( 'fsType' , [ self :: TYPE_PRIVATE , self :: TYPE_STARRED , self :: TYPE_PUBLIC ] ) , $ queryBuilder -> expr ( ) -> eq ( 'uID' , $ user -> getUserID ( ) ) ) ) -> orderBy ( 'fsName' , 'ASC' ) -> execute ( ) ; while ( $ row = $ results -> fetch ( ) ) { $ fileSet = new static ( ) ; $ fileSet = array_to_object ( $ fileSet , $ row ) ; $ fileSets [ ] = $ fileSet ; } return $ fileSets ; }
Returns all sets currently available to the User

@param bool|User|\Concrete\Core\User\UserInfo $user

@return static[]
Returns all sets currently available to the User