Source for file PrimitiveIO_boolean.class.php

Documentation is available at PrimitiveIO_boolean.class.php

  1. <?php
  2. /**
  3. * @package polyphony.datamanager_gui
  4. *
  5. * @copyright Copyright &copy; 2005, Middlebury College
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  7. *
  8. * @version $Id: PrimitiveIO_boolean.class.php,v 1.10 2007/09/19 14:04:44 adamfranco Exp $
  9. */
  10.  
  11. /**
  12. *
  13. *
  14. * @package polyphony.datamanager_gui
  15. *
  16. * @copyright Copyright &copy; 2005, Middlebury College
  17. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  18. *
  19. * @version $Id: PrimitiveIO_boolean.class.php,v 1.10 2007/09/19 14:04:44 adamfranco Exp $
  20. */
  21. class PrimitiveIO_boolean extends WRadioList /* implements PrimitiveIO */ {
  22. function PrimitiveIO_boolean () {
  23. $this->_eachPost = '';
  24. $this->addOption("1", "true");
  25. $this->addOption("0", "false");
  26. $zero = Boolean::withValue("0");
  27. $this->setValue($zero);
  28. }
  29. /**
  30. * Sets the value of this Component to the {@link SObject} passed.
  31. * @param ref object $value The {@link SObject} value to use.
  32. *
  33. * @return void
  34. ***/
  35. function setValue($value)
  36. {
  37. parent::setValue($value->value()?"1":"0");
  38. }
  39. /**
  40. * Sets the value of this Component to the {@link SObject} passed.
  41. * @param ref object $value The {@link SObject} value to use.
  42. *
  43. * @return void
  44. ***/
  45. function setValueFromSObject($value)
  46. {
  47. $this->setValue($value);
  48. }
  49. /**
  50. * Returns the values of wizard-components. Should return an array if children are involved,
  51. * otherwise a whatever type of object is expected.
  52. * @access public
  53. * @return mixed
  54. */
  55. function getAllValues () {
  56. $obj = new Boolean($this->_value=="1"?true:false);
  57. return $obj;
  58. }
  59.  
  60. }

Documentation generated on Wed, 19 Sep 2007 10:25:39 -0400 by phpDocumentor 1.3.0RC3