PageRenderTime 36ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/ezcomponents/Workflow/src/conditions/is_object.php

http://hppg.googlecode.com/
PHP | 54 lines | 13 code | 2 blank | 39 comment | 0 complexity | aeac248f2d32e6b6aa313d5ec56f367a MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause
  1. <?php
  2. /**
  3. * File containing the ezcWorkflowConditionIsObject class.
  4. *
  5. * @package Workflow
  6. * @version 1.4.1
  7. * @copyright Copyright (C) 2005-2010 eZ Systems AS. All rights reserved.
  8. * @license http://ez.no/licenses/new_bsd New BSD License
  9. */
  10. /**
  11. * Condition that evaluates to true if the evaluated value is an object.
  12. *
  13. * Typically used together with ezcWorkflowConditionVariable to use the
  14. * condition on a workflow variable.
  15. *
  16. * <code>
  17. * <?php
  18. * $condition = new ezcWorkflowConditionVariable(
  19. * 'variable name',
  20. * new ezcWorkflowConditionIsObject
  21. * );
  22. * ?>
  23. * </code>
  24. *
  25. * @package Workflow
  26. * @version 1.4.1
  27. */
  28. class ezcWorkflowConditionIsObject extends ezcWorkflowConditionType
  29. {
  30. /**
  31. * Evaluates this condition and returns true if $value is an object or false if not.
  32. *
  33. * @param mixed $value
  34. * @return boolean true when the condition holds, false otherwise.
  35. * @ignore
  36. */
  37. public function evaluate( $value )
  38. {
  39. return is_object( $value );
  40. }
  41. /**
  42. * Returns a textual representation of this condition.
  43. *
  44. * @return string
  45. * @ignore
  46. */
  47. public function __toString()
  48. {
  49. return 'is object';
  50. }
  51. }
  52. ?>