public function delete() {

		if (empty(static::$table))
			$table = strtolower(substr(static::class, strpos(static::class, '\\')+1));
		else
			$table = static::$table;

		if ($table != '') {
			if ($this->_id != '' || (is_array($this->_id) && count($this->_id) > 0) ) {
				$before = $this->before();
				if (is_array($before) && count($before) > 1) {
					if (isset($before['delete'])) {
						$delete = $before['delete'];
						while(list($field, $value) = each($delete))
							$this->_id[$field] = $value;
					}
				}
				$ret = self::$db->$table->delete($this->_id);
				$after = $this->after();
				if (is_array($after) && count($after) > 1) {
					if (isset($after['delete']) && is_callable($after['delete'])) {
						$delete = $after['delete'];
						$delete($this->_id);
					}
				}
				$this->_data[$table] = array();
			} else
				$ret = FALSE;
		}

		return $ret;
	}