public function destroy()
    {
        if (static::isVersioned()) {
            if (static::$createRevisionOnDestroy) {
                // save a copy to history table
                if ($this->fieldExists('Created')) {
                    $this->Created = time();
                }

                $recordValues = $this->_prepareRecordValues();
                $set = static::_mapValuesToSet($recordValues);

                DB::nonQuery(
                        'INSERT INTO `%s` SET %s',

                    [
                                static::getHistoryTable(),
                                join(',', $set),
                        ]
                );
            }
        }

        return static::delete($this->getPrimaryKeyValue());
    }
public function destroy()
    {
        if (static::isVersioned()) {
            if (static::$createRevisionOnDestroy) {
                // save a copy to history table
                if ($this->fieldExists('Created')) {
                    $this->Created = time();
                }

                $recordValues = $this->_prepareRecordValues();
                $set = static::_mapValuesToSet($recordValues);

                DB::nonQuery(
                        'INSERT INTO `%s` SET %s',

                    [
                                static::getHistoryTable(),
                                join(',', $set),
                        ]
                );
            }
        }

        return static::delete($this->getPrimaryKeyValue());
    }
public function destroy ( ) { if ( static :: isVersioned ( ) ) { if ( static :: $ createRevisionOnDestroy ) { // save a copy to history table if ( $ this -> fieldExists ( 'Created' ) ) { $ this -> Created = time ( ) ; } $ recordValues = $ this -> _prepareRecordValues ( ) ; $ set = static :: _mapValuesToSet ( $ recordValues ) ; DB :: nonQuery ( 'INSERT INTO `%s` SET %s' , [ static :: getHistoryTable ( ) , join ( ',' , $ set ) , ] ) ; } } return static :: delete ( $ this -> getPrimaryKeyValue ( ) ) ; }
Deletes this object.

@return bool True if database returns number of affected rows above 0. False otherwise.
Deletes this object .