1. sfOutputEscaperSafe.class.php
  2. /** * Marks a variable as being safe for output. * * @package symfony * @subpackage view * @author Fabien Potencier * @version SVN: $Id: sfOutputEscaperSafe.class.php 16553 2009-03-24 16:49:06Z Kris.Wallsmith $ */
  3. class sfOutputEscaperSafe extends ArrayIterator
  4. {
  5. protected
  6. $value = null;
  7. /**
  8. * Constructor.
  9. *
  10. * @param mixed $value The value to mark as safe
  11. */
  12. public function __construct($value)
  13. {
  14. $this->value = $value;
  15. if (is_array($value) || is_object($value))
  16. {
  17. parent::__construct($value);
  18. }
  19. }
  20. public function __toString()
  21. {
  22. return (string) $this->value;
  23. }
  24. public function __get($key)
  25. {
  26. return $this->value->$key;
  27. }
  28. public function __set($key, $value)
  29. {
  30. $this->value->$key = $value;
  31. }
  32. public function __call($method, $arguments)
  33. {
  34. return call_user_func_array(array($this->value, $method), $arguments);
  35. }
  36. public function __isset($key)
  37. {
  38. return isset($this->value->$key);
  39. }
  40. public function __unset($key)
  41. {
  42. unset($this->value->$key);
  43. }
  44. /**
  45. * Returns the embedded value.
  46. *
  47. * @return mixed The embedded value
  48. */
  49. public function getValue()
  50. {
  51. return $this->value;
  52. }
  53. }

Debug toolbar