code/GraphQL/UnpublishFileMutationCreator.php
protected function countLiveOwners(File $file)
    {
        // In case no versioning
        if (!$file->hasExtension(RecursivePublishable::class)) {
            return 0;
        }

        // Query live record
        /** @var Versioned|RecursivePublishable $liveRecord */
        $liveRecord = Versioned::get_by_stage(File::class, Versioned::LIVE)->byID($file->ID);
        if ($liveRecord) {
            return $liveRecord
                ->findOwners(false)
                ->count();
        }

        // No live record, no live owners
        return 0;
    }
protected function countLiveOwners(File $file)
    {
        // In case no versioning
        if (!$file->hasExtension(RecursivePublishable::class)) {
            return 0;
        }

        // Query live record
        /** @var Versioned|RecursivePublishable $liveRecord */
        $liveRecord = Versioned::get_by_stage(File::class, Versioned::LIVE)->byID($file->ID);
        if ($liveRecord) {
            return $liveRecord
                ->findOwners(false)
                ->count();
        }

        // No live record, no live owners
        return 0;
    }
protected function countLiveOwners ( File $ file ) { // In case no versioning if ( ! $ file -> hasExtension ( RecursivePublishable :: class ) ) { return 0 ; } // Query live record /** @var Versioned|RecursivePublishable $liveRecord */ $ liveRecord = Versioned :: get_by_stage ( File :: class , Versioned :: LIVE ) -> byID ( $ file -> ID ) ; if ( $ liveRecord ) { return $ liveRecord -> findOwners ( false ) -> count ( ) ; } // No live record, no live owners return 0 ; }
Count number of live owners this file uses

@param File $file
@return int Number of live owners
Count number of live owners this file uses