1<?php
2/**
3 * Return all KolabInetOrgPersons with the given uid, mail or alias address.
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 * Return all KolabInetOrgPersons with the given uid, mail or alias address.
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 */
28class Horde_Kolab_Server_Search_Operation_Guidforuidormailoralias
29extends Horde_Kolab_Server_Search_Operation_Restrictkolab
30{
31    /**
32     * Return all KolabInetOrgPersons with the given uid, mail or alias address.
33     *
34     * @param string $id The uid or mail address or alias address to search for.
35     *
36     * @return array The GUID(s).
37     *
38     * @throws Horde_Kolab_Server_Exception
39     */
40    public function searchGuidForUidOrMailOrAlias($id)
41    {
42        $criteria = new Horde_Kolab_Server_Query_Element_Or(
43            array(
44                new Horde_Kolab_Server_Query_Element_Equals(
45                    'Uid', $id
46                ),
47                new Horde_Kolab_Server_Query_Element_Equals(
48                    'Mail', $id
49                ),
50                new Horde_Kolab_Server_Query_Element_Equals(
51                    'Alias', $id
52                )
53            )
54        );
55        return parent::searchRestrictKolab($criteria);
56    }
57}