src/Versioned.php
public function hasPublishedOwners()
    {
        if (!$this->isPublished()) {
            return false;
        }
        // Count live owners
        /** @var Versioned|RecursivePublishable|DataObject $liveRecord */
        $liveRecord = static::get_by_stage(get_class($this->owner), Versioned::LIVE)->byID($this->owner->ID);
        return $liveRecord->findOwners(false)->count() > 0;
    }
public function hasPublishedOwners()
    {
        if (!$this->isPublished()) {
            return false;
        }
        // Count live owners
        /** @var Versioned|RecursivePublishable|DataObject $liveRecord */
        $liveRecord = static::get_by_stage(get_class($this->owner), Versioned::LIVE)->byID($this->owner->ID);
        return $liveRecord->findOwners(false)->count() > 0;
    }
public function hasPublishedOwners ( ) { if ( ! $ this -> isPublished ( ) ) { return false ; } // Count live owners /** @var Versioned|RecursivePublishable|DataObject $liveRecord */ $ liveRecord = static :: get_by_stage ( get_class ( $ this -> owner ) , Versioned :: LIVE ) -> byID ( $ this -> owner -> ID ) ; return $ liveRecord -> findOwners ( false ) -> count ( ) > 0 ; }
Determine if this object is published, and has any published owners.
If this is true, a warning should be shown before this is published.

Note: This method returns false if the object itself is unpublished,
since owners are only considered on the same stage as the record itself.

@return bool
Determine if this object is published and has any published owners . If this is true a warning should be shown before this is published .