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