src/Versioned.php
public function publishSingle()
    {
        $owner = $this->owner;
        // get the last published version
        $original = null;
        if ($this->isPublished()) {
            $original = self::get_by_stage($owner->baseClass(), self::LIVE)
                ->byID($owner->ID);
        }

        // Publish it
        $owner->invokeWithExtensions('onBeforePublish', $original);
        $owner->writeToStage(static::LIVE);
        $owner->invokeWithExtensions('onAfterPublish', $original);
        return true;
    }
public function publishSingle()
    {
        $owner = $this->owner;
        // get the last published version
        $original = null;
        if ($this->isPublished()) {
            $original = self::get_by_stage($owner->baseClass(), self::LIVE)
                ->byID($owner->ID);
        }

        // Publish it
        $owner->invokeWithExtensions('onBeforePublish', $original);
        $owner->writeToStage(static::LIVE);
        $owner->invokeWithExtensions('onAfterPublish', $original);
        return true;
    }
public function publishSingle ( ) { $ owner = $ this -> owner ; // get the last published version $ original = null ; if ( $ this -> isPublished ( ) ) { $ original = self :: get_by_stage ( $ owner -> baseClass ( ) , self :: LIVE ) -> byID ( $ owner -> ID ) ; } // Publish it $ owner -> invokeWithExtensions ( 'onBeforePublish' , $ original ) ; $ owner -> writeToStage ( static :: LIVE ) ; $ owner -> invokeWithExtensions ( 'onAfterPublish' , $ original ) ; return true ; }
Publishes this object to Live, but doesn't publish owned objects.

User code should call {@see canPublish()} prior to invoking this method.

@return bool True if publish was successful
Publishes this object to Live but doesn t publish owned objects .