1<?php
2/**
3 * A single query element.
4 *
5 * PHP version 5
6 *
7 * @category Kolab
8 * @package  Kolab_Server
9 * @author   Gunnar Wrobel <wrobel@pardus.de>
10 * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
11 * @link     http://pear.horde.org/index.php?package=Kolab_Server
12 */
13
14/**
15 * A single query element.
16 *
17 * Copyright 2008-2016 Horde LLC (http://www.horde.org/)
18 *
19 * See the enclosed file COPYING for license information (LGPL). If you
20 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
21 *
22 * @category Kolab
23 * @package  Kolab_Server
24 * @author   Gunnar Wrobel <wrobel@pardus.de>
25 * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
26 * @link     http://pear.horde.org/index.php?package=Kolab_Server
27 */
28abstract class Horde_Kolab_Server_Query_Element_Single
29implements Horde_Kolab_Server_Query_Element_Interface
30{
31    /**
32     * The element name.
33     *
34     * @var string
35     */
36    protected $_name;
37
38    /**
39     * The comparison value.
40     *
41     * @var mixed
42     */
43    protected $_value;
44
45    /**
46     * Constructor.
47     *
48     * @param string $name  The element name.
49     * @param mixed  $value The comparison value.
50     */
51    public function __construct($name, $value)
52    {
53        $this->_name  = $name;
54        $this->_value = $value;
55    }
56
57    /**
58     * Return the query element name.
59     *
60     * @return string The name of the query element.
61     */
62    public function getName()
63    {
64        return $this->_name;
65    }
66
67    /**
68     * Return the value of this element.
69     *
70     * @return mixed The query value.
71     */
72    public function getValue()
73    {
74        return $this->_value;
75    }
76
77    /**
78     * Return the elements of this group.
79     *
80     * This should never be called for single elements.
81     *
82     * @return mixed The group elements.
83     */
84    public function getElements()
85    {
86        throw new Horde_Kolab_Server_Exception('Not supported!');
87    }
88}