/ezcomponents/Workflow/src/conditions/is_object.php
PHP | 54 lines | 13 code | 2 blank | 39 comment | 0 complexity | aeac248f2d32e6b6aa313d5ec56f367a MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause
- <?php
- /**
- * File containing the ezcWorkflowConditionIsObject class.
- *
- * @package Workflow
- * @version 1.4.1
- * @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 object.
- *
- * Typically used together with ezcWorkflowConditionVariable to use the
- * condition on a workflow variable.
- *
- * <code>
- * <?php
- * $condition = new ezcWorkflowConditionVariable(
- * 'variable name',
- * new ezcWorkflowConditionIsObject
- * );
- * ?>
- * </code>
- *
- * @package Workflow
- * @version 1.4.1
- */
- class ezcWorkflowConditionIsObject extends ezcWorkflowConditionType
- {
- /**
- * Evaluates this condition and returns true if $value is an object or false if not.
- *
- * @param mixed $value
- * @return boolean true when the condition holds, false otherwise.
- * @ignore
- */
- public function evaluate( $value )
- {
- return is_object( $value );
- }
- /**
- * Returns a textual representation of this condition.
- *
- * @return string
- * @ignore
- */
- public function __toString()
- {
- return 'is object';
- }
- }
- ?>