Documentation is available at classes_organization.php
- <?php
- include_once( 'classes_people.php' );
- class organization extends person {
- //NOTE - object type definition "organization"
- /*
- * still to work out:
- * phone number handling
- * verify relationships are working
- * verify new... works
- */
- //var $email;
- //var $firstName; ***
- //var $lastName; ***
- //var $userName;
- //var $password;
- //var $description;
- //var $sessionID; ***
- //var $sessionIP; ***
- //var $sessionTimestamp; ***
- var $URI;
- var $phone;
- var $fax;
- var $address;
- function organization( $constructID = NULL ) {
- parent::b_object( $constructID, 'organizations' );
- //convert variables from serialized db format to working display format
- if( $this->phone ) {
- $this->phone = to_phone( $this->phone );
- }
- if( $this->fax ) {
- $this->fax = to_phone( $this->fax );
- }
- if( $this->address ) {
- $this->address = unserialize( $this->address );
- }
- }
- //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_db( $values ) { }
- //function set_object( $values ) { }
- //function delete() { }
- function get_index() {
- if( $this->name ) {
- $objectIndex = $this->name;
- } else if( $this->URI ) {
- $objectIndex = $this->URI;
- } else if( $this->username ) {
- $objectIndex = $this->username;
- } else {
- $objectIndex = "new organization";
- }
- return $objectIndex;
- }
- function verify_set( $post ) {
- //sepcial handling for phone numbers
- //NOTE: WRITE ME!!!
- $data = array();
- //special handling for addresses
- if( $keys = array_keys( $post ) ) {
- $address = array();
- foreach( $keys as $key ) {
- if( strstr( $key, 'address_' ) ) { $address[ substr( $key, 8 ) ] = $post[$key]; }
- else { $data[$key] = $post[$key]; }
- }
- $data['address'] = $address;
- }
- if( $post['phone'] ) {
- //strip whitespace, periods, dashes, parenthesis
- //format to be in 0.000.000.0000 style
- //set updated version to post variable
- }
- parent::verify_set( $data );
- }
- }
- ?>
Documentation generated on Tue, 24 May 2005 03:57:10 -0400 by phpDocumentor 1.3.0RC3