concrete/src/Entity/File/File.php
public function isStarred($u = false)
    {
        if (!$u) {
            $u = new User();
        }
        $db = Loader::db();
        $r = $db->GetOne(
            'select fsfID from FileSetFiles fsf inner join FileSets fs on fs.fsID = fsf.fsID where fsf.fID = ? and fs.uID = ? and fs.fsType = ?',
            [$this->getFileID(), $u->getUserID(), FileSet::TYPE_STARRED]
        );

        return $r > 0;
    }
public function isStarred($u = false)
    {
        if (!$u) {
            $u = new User();
        }
        $db = Loader::db();
        $r = $db->GetOne(
            'select fsfID from FileSetFiles fsf inner join FileSets fs on fs.fsID = fsf.fsID where fsf.fID = ? and fs.uID = ? and fs.fsType = ?',
            [$this->getFileID(), $u->getUserID(), FileSet::TYPE_STARRED]
        );

        return $r > 0;
    }
public function isStarred ( $ u = false ) { if ( ! $ u ) { $ u = new User ( ) ; } $ db = Loader :: db ( ) ; $ r = $ db -> GetOne ( 'select fsfID from FileSetFiles fsf inner join FileSets fs on fs.fsID = fsf.fsID where fsf.fID = ? and fs.uID = ? and fs.fsType = ?' , [ $ this -> getFileID ( ) , $ u -> getUserID ( ) , FileSet :: TYPE_STARRED ] ) ; return $ r > 0 ; }
Tell if a file is starred by a user.

@param bool|User $u User to check against if they starred a file, If no user is provided we used the current user

@return bool true if the user starred
Tell if a file is starred by a user .