public function delete() {

		$this->fire_model_event( 'deleting' );

		foreach ( $this->get_all_relations() as $relation ) {
			$this->get_relation( $relation )->on_delete( $this );
		}

		static::make_query_object()->delete( $this->get_pk() );

		if ( static::$_cache ) {
			Cache::delete( $this );
		}

		$this->_exists = false;

		$this->fire_model_event( 'deleted' );
	}
public function delete() {

		$this->fire_model_event( 'deleting' );

		foreach ( $this->get_all_relations() as $relation ) {
			$this->get_relation( $relation )->on_delete( $this );
		}

		static::make_query_object()->delete( $this->get_pk() );

		if ( static::$_cache ) {
			Cache::delete( $this );
		}

		$this->_exists = false;

		$this->fire_model_event( 'deleted' );
	}
public function delete ( ) { $ this -> fire_model_event ( 'deleting' ) ; foreach ( $ this -> get_all_relations ( ) as $ relation ) { $ this -> get_relation ( $ relation ) -> on_delete ( $ this ) ; } static :: make_query_object ( ) -> delete ( $ this -> get_pk ( ) ) ; if ( static :: $ _cache ) { Cache :: delete ( $ this ) ; } $ this -> _exists = false ; $ this -> fire_model_event ( 'deleted' ) ; }
Delete this object from the database.

Will fire `deleting` and `deleted` events.

@since 1.0

@throws Exception
Delete this object from the database .