public function trash()
    {
        if ($this->fireBeforeTrashEvent($this)) {
            $result = DB::trash($this->bean);
            $this->fireAfterTrashEvent($result);
            return true;
        } else {
            return false;
        }
    }
public function trash()
    {
        if ($this->fireBeforeTrashEvent($this)) {
            $result = DB::trash($this->bean);
            $this->fireAfterTrashEvent($result);
            return true;
        } else {
            return false;
        }
    }
public function trash ( ) { if ( $ this -> fireBeforeTrashEvent ( $ this ) ) { $ result = DB :: trash ( $ this -> bean ) ; $ this -> fireAfterTrashEvent ( $ result ) ; return true ; } else { return false ; } }
Removes this bean from the database.

Usage:

<code>
$post = SampleModel::instance();
$post->title = 'my post';
$id = $post->save();
$post = SampleModel::load( $id );
$post->trash( $post );
</code>

In the example above, we create a new bean of SampleModel.
We then set the title of the bean to 'my post' and we
store the bean. The save() method will return the primary
key ID $id assigned by the database. We can now use this
ID to load the bean from the database again and delete it.

@return boolean true if trash was successful, else false
Removes this bean from the database .