1
<?php
2
/**
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the LGPL. For more information please see
17
 * <http://phing.info>.
18
 */
19

20
/**
21
 * Class that holds an XSLT parameter.
22
 *
23
 * @package phing.filters
24
 */
25
class XsltParam
26
{
27
    private $name;
28

29
    /**
30
     * @var RegisterSlot|string
31
     */
32
    private $expr;
33

34
    /**
35
     * Sets param name.
36
     *
37
     * @param string $name
38
     */
39 0
    public function setName($name)
40
    {
41 0
        $this->name = $name;
42
    }
43

44
    /**
45
     * Get param name.
46
     *
47
     * @return string
48
     */
49 0
    public function getName()
50
    {
51 0
        return $this->name;
52
    }
53

54
    /**
55
     * Sets expression value (alias to the setExpression()) method.
56
     *
57
     * @param string $v
58
     * @see   setExpression()
59
     */
60 0
    public function setValue($v)
61
    {
62 0
        $this->setExpression($v);
63
    }
64

65
    /**
66
     * Gets expression value (alias to the getExpression()) method.
67
     *
68
     * @return string
69
     * @see    getExpression()
70
     */
71 0
    public function getValue()
72
    {
73 0
        return $this->getExpression();
74
    }
75

76
    /**
77
     * Sets expression value.
78
     *
79
     * @param string $expr
80
     */
81 0
    public function setExpression($expr)
82
    {
83 0
        $this->expr = $expr;
84
    }
85

86
    /**
87
     * Sets expression to dynamic register slot.
88
     *
89
     * @param RegisterSlot $expr
90
     */
91 0
    public function setListeningExpression(RegisterSlot $expr)
92
    {
93 0
        $this->expr = $expr;
94
    }
95

96
    /**
97
     * Returns expression value -- performs lookup if expr is registerslot.
98
     *
99
     * @return string
100
     */
101 0
    public function getExpression()
102
    {
103 0
        if ($this->expr instanceof RegisterSlot) {
104 0
            return $this->expr->getValue();
105
        }
106

107 0
        return $this->expr;
108
    }
109
}

Read our documentation on viewing source code .

Loading