src/Behaviour/IsArchivedInterface/Implementation.php
public function moveToArchive($bulk = false)
    {
        $this->connection->transact(function () use ($bulk) {
            $this->triggerEvent('on_before_move_to_archive', [$bulk]);

            if ($bulk && method_exists($this, 'setOriginalIsArchived')) {
                $this->setOriginalIsArchived($this->getIsArchived());
            }

            $this->setIsArchived(true);
            $this->save();

            $this->triggerEvent('on_after_move_to_archive', [$bulk]);
        });
    }
public function moveToArchive($bulk = false)
    {
        $this->connection->transact(function () use ($bulk) {
            $this->triggerEvent('on_before_move_to_archive', [$bulk]);

            if ($bulk && method_exists($this, 'setOriginalIsArchived')) {
                $this->setOriginalIsArchived($this->getIsArchived());
            }

            $this->setIsArchived(true);
            $this->save();

            $this->triggerEvent('on_after_move_to_archive', [$bulk]);
        });
    }
public function moveToArchive ( $ bulk = false ) { $ this -> connection -> transact ( function ( ) use ( $ bulk ) { $ this -> triggerEvent ( 'on_before_move_to_archive' , [ $ bulk ] ) ; if ( $ bulk && method_exists ( $ this , 'setOriginalIsArchived' ) ) { $ this -> setOriginalIsArchived ( $ this -> getIsArchived ( ) ) ; } $ this -> setIsArchived ( true ) ; $ this -> save ( ) ; $ this -> triggerEvent ( 'on_after_move_to_archive' , [ $ bulk ] ) ; } ) ; }
Move to archive.

@param bool $bulk
Move to archive .