concrete/src/Page/Collection/Version/Version.php
public function discard()
    {
        if ($this->isNew()) {
            $app = Facade::getFacadeApplication();
            $db = $app->make('database')->connection();
            // check for related version edits. This only gets applied when we edit global areas.
            $r = $db->executeQuery('select cRelationID, cvRelationID from CollectionVersionRelatedEdits where cID = ? and cvID = ?', array(
                $this->cID,
                $this->cvID,
            ));
            while ($row = $r->fetch()) {
                $cn = Page::getByID($row['cRelationID'], $row['cvRelationID']);
                $cnp = new Permissions($cn);
                if ($cnp->canApprovePageVersions()) {
                    $v = $cn->getVersionObject();
                    $v->delete();
                    $db->executeQuery('delete from CollectionVersionRelatedEdits where cID = ? and cvID = ? and cRelationID = ? and cvRelationID = ?', array(
                        $this->cID,
                        $this->cvID,
                        $row['cRelationID'],
                        $row['cvRelationID'],
                    ));
                }
            }
            $this->delete();
        }
        $this->refreshCache();
    }
public function discard()
    {
        if ($this->isNew()) {
            $app = Facade::getFacadeApplication();
            $db = $app->make('database')->connection();
            // check for related version edits. This only gets applied when we edit global areas.
            $r = $db->executeQuery('select cRelationID, cvRelationID from CollectionVersionRelatedEdits where cID = ? and cvID = ?', array(
                $this->cID,
                $this->cvID,
            ));
            while ($row = $r->fetch()) {
                $cn = Page::getByID($row['cRelationID'], $row['cvRelationID']);
                $cnp = new Permissions($cn);
                if ($cnp->canApprovePageVersions()) {
                    $v = $cn->getVersionObject();
                    $v->delete();
                    $db->executeQuery('delete from CollectionVersionRelatedEdits where cID = ? and cvID = ? and cRelationID = ? and cvRelationID = ?', array(
                        $this->cID,
                        $this->cvID,
                        $row['cRelationID'],
                        $row['cvRelationID'],
                    ));
                }
            }
            $this->delete();
        }
        $this->refreshCache();
    }
public function discard ( ) { if ( $ this -> isNew ( ) ) { $ app = Facade :: getFacadeApplication ( ) ; $ db = $ app -> make ( 'database' ) -> connection ( ) ; // check for related version edits. This only gets applied when we edit global areas. $ r = $ db -> executeQuery ( 'select cRelationID, cvRelationID from CollectionVersionRelatedEdits where cID = ? and cvID = ?' , array ( $ this -> cID , $ this -> cvID , ) ) ; while ( $ row = $ r -> fetch ( ) ) { $ cn = Page :: getByID ( $ row [ 'cRelationID' ] , $ row [ 'cvRelationID' ] ) ; $ cnp = new Permissions ( $ cn ) ; if ( $ cnp -> canApprovePageVersions ( ) ) { $ v = $ cn -> getVersionObject ( ) ; $ v -> delete ( ) ; $ db -> executeQuery ( 'delete from CollectionVersionRelatedEdits where cID = ? and cvID = ? and cRelationID = ? and cvRelationID = ?' , array ( $ this -> cID , $ this -> cvID , $ row [ 'cRelationID' ] , $ row [ 'cvRelationID' ] , ) ) ; } } $ this -> delete ( ) ; } $ this -> refreshCache ( ) ; }
Discard my most recent edit that is pending.
Discard my most recent edit that is pending .