src/Versioned.php
protected function createDeletedVersion($stages = [])
    {
        // Skip if suppressed by parent delete
        if (!$this->getDeleteWritesVersion()) {
            return;
        }
        // Prepare manipulation
        $baseTable = $this->owner->baseTable();
        $now = DBDatetime::now()->Rfc2822();
        // Ensure all fixed_fields are specified
        $manipulation = [
            $baseTable => [
                'fields' => [
                    'ID' => $this->owner->ID,
                    'LastEdited' => $now,
                    'Created' => $this->owner->Created ?: $now,
                    'ClassName' => $this->owner->ClassName,
                ],
            ],
        ];
        // Prepare "deleted" augment write
        $this->augmentWriteVersioned(
            $manipulation,
            $this->owner->baseClass(),
            $baseTable,
            $this->owner->ID,
            $stages,
            true
        );
        unset($manipulation[$baseTable]);
        $this->owner->extend('augmentWriteDeletedVersion', $manipulation, $stages);
        DB::manipulate($manipulation);
    }
protected function createDeletedVersion($stages = [])
    {
        // Skip if suppressed by parent delete
        if (!$this->getDeleteWritesVersion()) {
            return;
        }
        // Prepare manipulation
        $baseTable = $this->owner->baseTable();
        $now = DBDatetime::now()->Rfc2822();
        // Ensure all fixed_fields are specified
        $manipulation = [
            $baseTable => [
                'fields' => [
                    'ID' => $this->owner->ID,
                    'LastEdited' => $now,
                    'Created' => $this->owner->Created ?: $now,
                    'ClassName' => $this->owner->ClassName,
                ],
            ],
        ];
        // Prepare "deleted" augment write
        $this->augmentWriteVersioned(
            $manipulation,
            $this->owner->baseClass(),
            $baseTable,
            $this->owner->ID,
            $stages,
            true
        );
        unset($manipulation[$baseTable]);
        $this->owner->extend('augmentWriteDeletedVersion', $manipulation, $stages);
        DB::manipulate($manipulation);
    }
protected function createDeletedVersion ( $ stages = [ ] ) { // Skip if suppressed by parent delete if ( ! $ this -> getDeleteWritesVersion ( ) ) { return ; } // Prepare manipulation $ baseTable = $ this -> owner -> baseTable ( ) ; $ now = DBDatetime :: now ( ) -> Rfc2822 ( ) ; // Ensure all fixed_fields are specified $ manipulation = [ $ baseTable => [ 'fields' => [ 'ID' => $ this -> owner -> ID , 'LastEdited' => $ now , 'Created' => $ this -> owner -> Created ? : $ now , 'ClassName' => $ this -> owner -> ClassName , ] , ] , ] ; // Prepare "deleted" augment write $ this -> augmentWriteVersioned ( $ manipulation , $ this -> owner -> baseClass ( ) , $ baseTable , $ this -> owner -> ID , $ stages , true ) ; unset ( $ manipulation [ $ baseTable ] ) ; $ this -> owner -> extend ( 'augmentWriteDeletedVersion' , $ manipulation , $ stages ) ; DB :: manipulate ( $ manipulation ) ; }
Adds a WasDeleted=1 version entry for this record, and records any stages
the deletion applies to

@param string[]|string $stages Stage or array of affected stages
Adds a WasDeleted = 1 version entry for this record and records any stages the deletion applies to