1: <?php
2: /**
3: * Copyright 2010-2014 Horde LLC (http://www.horde.org/)
4: *
5: * See the enclosed file COPYING for license information (GPL). If you
6: * did not receive this file, see http://www.horde.org/licenses/gpl.
7: *
8: * @category Horde
9: * @copyright 2010-2014 Horde LLC
10: * @license http://www.horde.org/licenses/gpl GPL
11: * @package IMP
12: */
13:
14: /**
15: * This class provides the data structure for a message flag.
16: *
17: * @author Michael Slusarz <slusarz@horde.org>
18: * @category Horde
19: * @copyright 2010-2014 Horde LLC
20: * @license http://www.horde.org/licenses/gpl GPL
21: * @package IMP
22: *
23: * @property-read string $imapflag The IMAP flag string.
24: */
25: abstract class IMP_Flag_Imap extends IMP_Flag_Base
26: {
27: /**
28: * The IMAP flag string used on the server.
29: *
30: * @var string
31: */
32: protected $_imapflag;
33:
34: /**
35: */
36: public function __get($name)
37: {
38: switch ($name) {
39: case 'id':
40: case 'imapflag':
41: return $this->_imapflag;
42:
43: default:
44: return parent::__get($name);
45: }
46: }
47:
48: /**
49: * @param array $data List of IMAP flags.
50: */
51: public function match($data)
52: {
53: foreach ($data as $val) {
54: if (strcasecmp($this->imapflag, $val) === 0) {
55: return true;
56: }
57: }
58:
59: return false;
60: }
61:
62: }
63: