public function delete($query, array $options = []) {
		$params = compact('query', 'options');

		return Filters::run($this, __FUNCTION__, $params, function($params) {
			$query = $params['query'];
			$isObject = is_object($query);

			if ($isObject) {
				$sql = $this->renderCommand('delete', $query->export($this), $query);
			} else {
				$sql = Text::insert($query, $this->value($params['options']));
			}
			$result = (boolean) $this->_execute($sql);

			if ($result && $isObject && $query->entity()) {
				$query->entity()->sync(null, [], ['dematerialize' => true]);
			}
			return $result;
		});
	}
public function delete($query, array $options = []) {
		$params = compact('query', 'options');

		return Filters::run($this, __FUNCTION__, $params, function($params) {
			$query = $params['query'];
			$isObject = is_object($query);

			if ($isObject) {
				$sql = $this->renderCommand('delete', $query->export($this), $query);
			} else {
				$sql = Text::insert($query, $this->value($params['options']));
			}
			$result = (boolean) $this->_execute($sql);

			if ($result && $isObject && $query->entity()) {
				$query->entity()->sync(null, [], ['dematerialize' => true]);
			}
			return $result;
		});
	}
public function delete ( $ query , array $ options = [ ] ) { $ params = compact ( 'query' , 'options' ) ; return Filters :: run ( $ this , __FUNCTION__ , $ params , function ( $ params ) { $ query = $ params [ 'query' ] ; $ isObject = is_object ( $ query ) ; if ( $ isObject ) { $ sql = $ this -> renderCommand ( 'delete' , $ query -> export ( $ this ) , $ query ) ; } else { $ sql = Text :: insert ( $ query , $ this -> value ( $ params [ 'options' ] ) ) ; } $ result = ( boolean ) $ this -> _execute ( $ sql ) ; if ( $ result && $ isObject && $ query -> entity ( ) ) { $ query -> entity ( ) -> sync ( null , [ ] , [ 'dematerialize' => true ] ) ; } return $ result ; } ) ; }
Deletes a record in the database based on the given `Query`.

@param object $query An SQL string, or `lithium\data\model\Query` object instance.
@param array $options If `$query` is a string, `$options` is the array of quoted/escaped
parameter values to be inserted into the query.
@return boolean Returns `true` on successful query execution (not necessarily if records are
deleted), otherwise `false`.
@filter
Deletes a record in the database based on the given Query .