1: <?php
2: /**
3: * The Ingo_Script_Maildrop_Variable:: class represents a Maildrop variable.
4: *
5: * Copyright 2005-2007 Matt Weyland <mathias@weyland.ch>
6: *
7: * See the enclosed file LICENSE for license information (ASL). If you
8: * did not receive this file, see http://www.horde.org/licenses/apache.
9: *
10: * @author Matt Weyland <mathias@weyland.ch>
11: * @package Ingo
12: */
13: class Ingo_Script_Maildrop_Variable
14: {
15: /**
16: */
17: protected $_name;
18:
19: /**
20: */
21: protected $_value;
22:
23: /**
24: * Constructs a new maildrop variable.
25: *
26: * @param array $params Array of parameters. Expected fields are 'name'
27: * and 'value'.
28: */
29: public function __construct($params = array())
30: {
31: $this->_name = $params['name'];
32: $this->_value = $params['value'];
33: }
34:
35: /**
36: * Generates maildrop code to represent the variable.
37: *
38: * @return string maildrop code to represent the variable.
39: */
40: public function generate()
41: {
42: return $this->_name . '=' . $this->_value . "\n";
43: }
44:
45: }
46: