1<?php
2/**
3 * Horde_ActiveSync_Message_Attendee
4 *
5 * Portions of this class were ported from the Z-Push project:
6 *   File      :   wbxml.php
7 *   Project   :   Z-Push
8 *   Descr     :   WBXML mapping file
9 *
10 *   Created   :   01.10.2007
11 *
12 *   � Zarafa Deutschland GmbH, www.zarafaserver.de
13 *   This file is distributed under GPL-2.0.
14 *   Consult COPYING file for details
15 *
16 * @license   http://www.horde.org/licenses/gpl GPLv2
17 *
18 * @copyright 2010-2020 Horde LLC (http://www.horde.org)
19 * @author    Michael J Rubinsky <mrubinsk@horde.org>
20 * @package   ActiveSync
21 */
22/**
23 * Horde_ActiveSync_Message_Attendee
24 *
25 * @license   http://www.horde.org/licenses/gpl GPLv2
26 *
27 * @copyright 2010-2020 Horde LLC (http://www.horde.org)
28 * @author    Michael J Rubinsky <mrubinsk@horde.org>
29 * @package   ActiveSync
30 *
31 * @property string   $email   The attendee's email address.
32 * @property string   $name    The attendee's name.
33 * @property integer  $status  The attendee's status (a STATUS_* constant).
34 * @property integer  $type    The attendee type (a TYPE_* constant)
35 */
36class Horde_ActiveSync_Message_Attendee extends Horde_ActiveSync_Message_Base
37{
38    /* Attendee Type Constants */
39    const TYPE_REQUIRED     = 1;
40    const TYPE_OPTIONAL     = 2;
41    const TYPE_RESOURCE     = 3;
42
43    /* Attendee Status */
44    const STATUS_UNKNOWN    = 0;
45    const STATUS_TENTATIVE  = 2;
46    const STATUS_ACCEPT     = 3;
47    const STATUS_DECLINE    = 4;
48    const STATUS_NORESPONSE = 5;
49
50    /**
51     * Property mapping.
52     *
53     * @var array
54     */
55    protected $_mapping = array(
56        Horde_ActiveSync_Message_Appointment::POOMCAL_EMAIL => array (self::KEY_ATTRIBUTE => 'email'),
57        Horde_ActiveSync_Message_Appointment::POOMCAL_NAME  => array (self::KEY_ATTRIBUTE => 'name'),
58        Horde_ActiveSync_Message_Appointment::POOMCAL_ATTENDEESTATUS => array(self::KEY_ATTRIBUTE => 'status'),
59        Horde_ActiveSync_Message_Appointment::POOMCAL_ATTENDEETYPE => array(self::KEY_ATTRIBUTE => 'type')
60    );
61
62    /**
63     * Property values.
64     *
65     * @var array
66     */
67    protected $_properties = array(
68        'email' => false,
69        'name'  => false,
70        'status' => false,
71        'type' => false
72    );
73
74    /**
75     * Give concrete classes the chance to enforce rules on property values.
76     *
77     * @return boolean  True on success, otherwise false.
78     */
79    protected function _validateDecodedValues()
80    {
81        if ($this->_version == Horde_ActiveSync::VERSION_SIXTEEN &&
82            !empty($this->_properties['status'])) {
83            return false;
84        }
85
86        return true;
87    }
88
89}
90