Source for file PrimitiveIO_Authoritative.class.php

Documentation is available at PrimitiveIO_Authoritative.class.php

  1. <?php
  2. /**
  3. * @since 5/1/06
  4. * @package polyphony.datamanager_gui
  5. *
  6. * @copyright Copyright &copy; 2005, Middlebury College
  7. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  8. *
  9. * @version $Id: PrimitiveIO_Authoritative.class.php,v 1.5 2007/09/19 14:04:44 adamfranco Exp $
  10. */
  11.  
  12. /**
  13. * This class implements standard methods needed by the Authoritative versions
  14. * of the primitive IO classes, for behaving as select lists.
  15. *
  16. * @since 5/1/06
  17. * @package polyphony.datamanager_gui
  18. *
  19. * @copyright Copyright &copy; 2005, Middlebury College
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  21. *
  22. * @version $Id: PrimitiveIO_Authoritative.class.php,v 1.5 2007/09/19 14:04:44 adamfranco Exp $
  23. */
  24. class PrimitiveIO_Authoritative
  25. extends WSelectList
  26. {
  27. /**
  28. * Sets the value of this Component to the {@link SObject} passed.
  29. * @param ref object $value The {@link SObject} value to use.
  30. *
  31. * @return void
  32. ***/
  33. function setValue($value)
  34. {
  35. if (is_object($value)) {
  36. ArgumentValidator::validate($value, HasMethodsValidatorRule::getRule("asString"));
  37. parent::setValue($value->asString());
  38. } else
  39. parent::setValue($value);
  40. }
  41. /**
  42. * Sets the value of this Component to the {@link SObject} passed.
  43. * @param ref object $value The {@link SObject} value to use.
  44. *
  45. * @return void
  46. ***/
  47. function setValueFromSObject($value)
  48. {
  49. $this->setValue($value);
  50. }
  51. /**
  52. * Answer true if the value passed is a valid option
  53. *
  54. * @param string $value
  55. * @return boolean
  56. * @access public
  57. * @since 4/28/06
  58. */
  59. function isOption ($value) {
  60. if (is_object($value)) {
  61. ArgumentValidator::validate($value, HasMethodsValidatorRule::getRule("asString"));
  62. return parent::isOption($value->asString());
  63. } else
  64. return parent::isOption($value);
  65. }
  66. /**
  67. * Add an option to our choose list
  68. *
  69. * @param object SObject $valueObject
  70. * @return void
  71. * @access public
  72. * @since 5/1/06
  73. */
  74. function addOptionFromSObject ( $valueObject ) {
  75. ArgumentValidator::validate($valueObject, ExtendsValidatorRule::getRule('SObject'));
  76. $this->addOption($valueObject->asString(), $valueObject->asString());
  77. }
  78. }
  79.  
  80. ?>

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