Path

ez components / documentation / api reference / 2008.1 / workflow


Workflow

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Source for file condition_comparison.php

Documentation is available at condition_comparison.php

 1. <?php
 2. /**
 3.  * File containing the ezcWorkflowConditionComparison class.
 4.  *
 5.  * @package Workflow
 6.  * @version 1.2
 7.  * @copyright Copyright (C) 2005-2008 eZ systems as. All rights reserved.
 8.  * @license http://ez.no/licenses/new_bsd New BSD License
 9.  */
10.  
11. /**
12.  * Abstract base class for comparison conditions.
13.  *
14.  * @package Workflow
15.  * @version 1.2
16.  */
17. abstract class ezcWorkflowConditionComparison implements ezcWorkflowCondition
18. {
19.     /**
20.      * @var mixed 
21.      */
22.     protected $operator = '';
23.  
24.     /**
25.      * @var mixed 
26.      */
27.     protected $value;
28.  
29.     /**
30.      * Constructs a new comparison condition.
31.      *
32.      * Implemenations will compare $value to the value provided to evaluate().
33.      *
34.      * @param  mixed  $value 
35.      */
36.     public function __construct$value null )
37.     {
38.         $this->value = $value;
39.     }
40.  
41.     /**
42.      * Returns the value that this condition compares against.
43.      *
44.      * @return mixed 
45.      * @ignore
46.      */
47.     public function getValue()
48.     {
49.         return $this->value;
50.     }
51.  
52.     /**
53.      * Sets the value that this condition compares against.
54.      *
55.      * @param mixed $value 
56.      * @ignore
57.      */
58.     public function setValue$value )
59.     {
60.         $this->value = $value;
61.     }
62.  
63.     /**
64.      * Returns the operator.
65.      *
66.      * @return string 
67.      * @ignore
68.      */
69.     public function getOperator()
70.     {
71.         return $this->operator;
72.     }
73.  
74.     /**
75.      * Returns a textual representation of this condition.
76.      *
77.      * @return string 
78.      * @ignore
79.      */
80.     public function __toString()
81.     {
82.         return $this->operator . ' ' $this->value;
83.     }
84. }
85. ?>
Last updated: Wed, 18 Jun 2008