Source for file classes_comment.php

Documentation is available at classes_comment.php

  1. <?php
  2.  
  3. class comment extends b_object {
  4. //NOTE - object type definition "user types"
  5. var $comment_date;
  6. var $text;
  7. var $author_name;
  8. var $author_email;
  9. var $author_URI;
  10.  
  11. function comment( $constructID = NULL ) {
  12. parent::b_object( $constructID, 'comments' );
  13. $this->comment_date = toPhpDate( $this->comment_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->text ) {
  31. $objectIndex = limitString( $this->text, 10 );
  32. } else {
  33. $objectIndex = "new comment";
  34. }
  35. return $objectIndex;
  36. }
  37.  
  38. function verify_set( $comment ) {
  39. //verifies data before setting the object's values - returns an error array if problems are found
  40. $returnArray = array();
  41. if( isset($comment['comment_date']) ) {
  42. if( $comment['comment_date'] ) {
  43. $comment['comment_date'] = toDbDate( $comment['comment_date'] );
  44. } else {
  45. $comment['comment_date'] = toDbDate( 'today' );
  46. }
  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( $comment );
  52. //} else {
  53. //$GLOBALS['errorArray'] = $returnArray;
  54. //$this->set_object( $comment );
  55. //}
  56. }
  57. }
  58.  
  59. ?>

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