src/RecursivePublishable.php
public function hasOwned()
    {
        if (!$this->owner->isInDB()) {
            return false;
        }

        $ownedRelationships = $this->owner->config()->get('owns') ?: [];
        foreach ($ownedRelationships as $relationship) {
            /* @var DataObject|SS_List $result */
            $result = $this->owner->{$relationship}();
            if ($result->exists()) {
                return true;
            }
        }

        return false;
    }
public function hasOwned()
    {
        if (!$this->owner->isInDB()) {
            return false;
        }

        $ownedRelationships = $this->owner->config()->get('owns') ?: [];
        foreach ($ownedRelationships as $relationship) {
            /* @var DataObject|SS_List $result */
            $result = $this->owner->{$relationship}();
            if ($result->exists()) {
                return true;
            }
        }

        return false;
    }
public function hasOwned ( ) { if ( ! $ this -> owner -> isInDB ( ) ) { return false ; } $ ownedRelationships = $ this -> owner -> config ( ) -> get ( 'owns' ) ? : [ ] ; foreach ( $ ownedRelationships as $ relationship ) { /* @var DataObject|SS_List $result */ $ result = $ this -> owner -> { $ relationship } ( ) ; if ( $ result -> exists ( ) ) { return true ; } } return false ; }
Returns true if the record has any owned relationships that exist
@return bool
Returns true if the record has any owned relationships that exist