Source for file PrimitiveIO_blob.class.php

Documentation is available at PrimitiveIO_blob.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_blob.class.php,v 1.9 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_blob.class.php,v 1.9 2007/09/19 14:04:44 adamfranco Exp $
  20. */
  21. class PrimitiveIO_blob
  22. extends PrimitiveIO
  23. {
  24.  
  25. var $_blob;
  26. function PrimitiveIO_blob () {
  27. // do nothing.
  28. }
  29.  
  30. /**
  31. * Sets the value of this Component to the {@link SObject} passed.
  32. * @param ref object $value The {@link SObject} value to use.
  33. *
  34. * @return void
  35. ***/
  36. function setValue($value)
  37. {
  38. $this->_blob =$value;
  39. }
  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. /**
  53. * Returns true if this component (and all child components if applicable) have valid values.
  54. * By default, this will just return TRUE. Validate should be called usually before a save event
  55. * is handled, to make sure everything went smoothly.
  56. * @access public
  57. * @return boolean
  58. */
  59. function validate () {
  60. return true;
  61. }
  62.  
  63. /**
  64. * Tells the wizard component to update itself - this may include getting
  65. * form post data or validation - whatever this particular component wants to
  66. * do every pageload.
  67. * @param string $fieldName The field name to use when outputting form data or
  68. * similar parameters/information.
  69. * @access public
  70. * @return boolean - TRUE if everything is OK
  71. */
  72. function update ($fieldName) {
  73. // do nothing.
  74. }
  75.  
  76. /**
  77. * Returns the values of wizard-components. Should return an array if children are involved,
  78. * otherwise a whatever type of object is expected.
  79. * @access public
  80. * @return mixed
  81. */
  82. function getAllValues () {
  83. return $this->_blob?$this->_blob->value():"";
  84. }
  85.  
  86. /**
  87. * Returns a block of XHTML-valid code that contains markup for this specific
  88. * component.
  89. * @param string $fieldName The field name to use when outputting form data or
  90. * similar parameters/information.
  91. * @access public
  92. * @return string
  93. */
  94. function getMarkup ($fieldName) {
  95. return dgettext("polyphony", "Blob data") . ": " . strlen($this->_blob?$this->_blob->value():"") . " " . dgettext("polyphony", "bytes");
  96. }
  97. }

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