Source for file classes_project.php

Documentation is available at classes_project.php

  1. <?php
  2.  
  3. class project extends b_object {
  4. //NOTE - object type definition "user types"
  5. var $name;
  6. var $start_date;
  7. var $finish_date;
  8. var $description;
  9.  
  10. function project( $constructID = NULL ) {
  11. parent::b_object( $constructID, 'projects' );
  12. $this->start_date = toPhpDate( $this->start_date );
  13. $this->finish_date = toPhpDate( $this->finish_date );
  14. }
  15. //NOTE: these functions are here to overload the base class functions if special data validation etc is needed
  16. //function &get_attribute( $attribute ) { }
  17. //function set_attribute( $attribute, $value ) { }
  18. //function set( $values ) { }
  19. //function set_db( $values ) { }
  20. //function set_object( $values ) { }
  21. //function delete() { }
  22. function get_contents( $navArray = NULL ) {
  23. //format navigation array
  24. //format object diplay fields
  25. $rawFieldArray = $this->type->get_attribute( 'type_object_field_list' );
  26. return parent::get_contents( $navArray, $rawFieldArray );
  27. }
  28.  
  29. function get_index() {
  30. if( $this->name ) {
  31. $objectIndex = $this->name;
  32. } else {
  33. $objectIndex = "new project";
  34. }
  35. return $objectIndex;
  36. }
  37.  
  38. function verify_set( $post ) {
  39. //verifies data before setting the object's values - returns an error array if problems are found
  40. $returnArray = array();
  41.  
  42. if( $post['start_date'] ) {
  43. $post['start_date'] = toDbDate( $post['start_date'] );
  44. }
  45. if( $post['finish_date'] ) {
  46. $post['finish_date'] = toDbDate( $post['finish_date'] );
  47. }
  48.  
  49. //if( !count($returnArray) ) {
  50. //THIS IS CRITICAL if you want to be able to relate things to the object
  51. parent::verify_set( $post );
  52. //} else {
  53. //$GLOBALS['errorArray'] = $returnArray;
  54. //$this->set_object( $post );
  55. //}
  56. }
  57. }
  58.  
  59. ?>

Documentation generated on Tue, 24 May 2005 03:57:15 -0400 by phpDocumentor 1.3.0RC3