Documentation is available at classes_post.php
- <?php
- class post extends b_object {
- //NOTE - object type definition "user types"
- var $title;
- var $post_date;
- var $text;
- function post( $constructID = NULL ) {
- parent::b_object( $constructID, 'posts' );
- $this->post_date = toPhpDate( $this->post_date );
- }
- //NOTE: these functions are here to overload the base class functions if special data validation etc is needed
- //function &get_attribute( $attribute ) { }
- //function set_attribute( $attribute, $value ) { }
- //function set( $values ) { }
- //function set_db( $values ) { }
- //function set_object( $values ) { }
- //function delete() { }
- function get_contents( $navArray = NULL ) {
- //format navigation array
- //format object diplay fields
- $rawFieldArray = $this->type->get_attribute( 'type_object_field_list' );
- return parent::get_contents( $navArray, $rawFieldArray );
- }
- function get_index() {
- if( $this->title ) {
- $objectIndex = $this->title;
- } else {
- $objectIndex = "new post";
- }
- return $objectIndex;
- }
- function verify_set( $post ) {
- //verifies data before setting the object's values - returns an error array if problems are found
- $returnArray = array();
- if( !$post['title'] ) {
- $returnArray['title'] = 'no title given - please enter a title';
- }
- if( isset($post['post_date']) ) {
- if( $post['post_date'] ) {
- $post['post_date'] = toDbDate( $post['post_date'] );
- } else {
- $post['post_date'] = toDbDate( 'today' );
- }
- }
- if( !count($returnArray) ) {
- //THIS IS CRITICAL if you want to be able to relate things to the object
- parent::verify_set( $post );
- } else {
- $GLOBALS['errorArray'] = $returnArray;
- $this->set_object( $post );
- }
- }
- }
- ?>
Documentation generated on Tue, 24 May 2005 03:57:14 -0400 by phpDocumentor 1.3.0RC3