<?php
/*
 * Copyright (c) 2010, webvariants GbR, http://www.webvariants.de
 *
 * This file is released under the terms of the MIT license. You can find the
 * complete text in the attached LICENSE file or online at:
 *
 * http://www.opensource.org/licenses/mit-license.php
 */

class WV_Filter_Not implements WV_IFilter {
	protected $filter;

	public function __construct(WV_IFilter $filter) {
		$this->filter = $filter;
	}

	public function __toString() {
		return $this->toSQL();
	}

	public function toSQL() {
		return '(NOT ('.$this->filter->toSQL().'))';
	}

	public function getRequiredTables() {
		return $this->filter->getRequiredTables();
	}

	public function isValid() {
		return $this->filter->isValid();
	}
}
