| <?php |
| /** |
| * File containing the ezcWorkflowConditionIsInteger class. |
| * |
| * @package Workflow |
| * @version //autogen// |
| * @copyright Copyright (C) 2005-2010 eZ Systems AS. All rights reserved. |
| * @license http://ez.no/licenses/new_bsd New BSD License |
| */ |
| |
| /** |
| * Condition that evaluates to true if the evaluated value is an integer. |
| * |
| * Typically used together with ezcWorkflowConditionVariable to use the |
| * condition on a workflow variable. |
| * |
| * <code> |
| * <?php |
| * $condition = new ezcWorkflowConditionVariable( |
| * 'variable name', |
| * new ezcWorkflowConditionIsInteger |
| * ); |
| * ?> |
| * </code> |
| * |
| * @package Workflow |
| * @version //autogen// |
| */ |
| class ezcWorkflowConditionIsInteger extends ezcWorkflowConditionType |
| { |
| /** |
| * Evaluates this condition and returns true if $value is an integer or false if not. |
| * |
| * @param mixed $value |
| * @return boolean true when the condition holds, false otherwise. |
| * @ignore |
| */ |
| public function evaluate( $value ) |
| { |
| return is_int( $value ); |
| } |
| |
| /** |
| * Returns a textual representation of this condition. |
| * |
| * @return string |
| * @ignore |
| */ |
| public function __toString() |
| { |
| return 'is integer'; |
| } |
| } |
| ?> |