Source for file PrimitiveIO_Authoritative_datetime.class.php

Documentation is available at PrimitiveIO_Authoritative_datetime.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_Authoritative_datetime.class.php,v 1.4 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_Authoritative_datetime.class.php,v 1.4 2007/09/19 14:04:44 adamfranco Exp $
  20. */
  21. class PrimitiveIO_Authoritative_datetime
  22. extends PrimitiveIO_Authoritative
  23. /* implements PrimitiveIO */
  24. {
  25.  
  26. function PrimitiveIO_Authoritative_datetime() {
  27. // $this->setErrorText(dgettext("polyphony", "Enter a date/time string. (example: YYYY-MM-DD HH:MM:SS)"));
  28. // $this->setErrorRule(new WECNonZeroRegex("[\\w]+"));
  29. }
  30. /**
  31. * Returns true if this component (and all child components if applicable) have valid values.
  32. * By default, this will just return TRUE. Validate should be called usually before a save event
  33. * is handled, to make sure everything went smoothly.
  34. * @access public
  35. * @return boolean
  36. */
  37. function validate () {
  38. $parse = StringParser::getParserFor($this->_value);
  39. if (!$parse) {
  40. $this->_showError = true;
  41. return false;
  42. }
  43. return true;
  44. }
  45.  
  46. /**
  47. * Returns the values of wizard-components. Should return an array if children are involved,
  48. * otherwise a whatever type of object is expected.
  49. * @access public
  50. * @return mixed
  51. */
  52. function getAllValues () {
  53. $obj = DateAndTime::fromString($this->_value);
  54. return $obj;
  55. }
  56. }

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