1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8class Search_Expr_Not implements Search_Expr_Interface
9{
10	private $expression;
11	private $weight = 1.0;
12
13	function __construct($expression)
14	{
15		$this->expression = $expression;
16	}
17
18	function __clone()
19	{
20		$this->expression = clone $this->expression;
21	}
22
23	function setType($type)
24	{
25		$this->expression->setType($type);
26	}
27
28	function setField($field = 'global')
29	{
30		$this->expression->setField($field);
31	}
32
33	function setWeight($weight)
34	{
35		$this->weight = (float) $weight;
36	}
37
38	function getWeight()
39	{
40		return $this->weight;
41	}
42
43	function walk($callback)
44	{
45		$result = $this->expression->walk($callback);
46
47		return call_user_func($callback, $this, [$result]);
48	}
49
50	function traverse($callback)
51	{
52		return call_user_func($callback, $callback, $this, [$this->expression]);
53	}
54}
55