Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

desperate help need

Status
Not open for further replies.

wolf73

Programmer
Feb 12, 2006
93
CA
I am very new to Objected Orientated, I am trying to do something like the following.

Create a class called MuzeUpdater. In this class make several functions for updating our db. Have a function for every table, and in turn have a function that calls all the necessary functions to do the full update. Only the Main function, and each of the functions that start the updating process for each table should be public. Contain all the parsing logic in one or more private functions that every one of the public functions will use (except the main one).

How would the structure of my class would look like?

Thanks
 
You might want to read the PHP online manual entry on the sibject.

The main strucutre would look like:

Code:
class myclass{
$variables_you_might_need

Private function whatever(parameters){

Do something with the paramters...

}


Public function somethingelse(parameters){
do saomething else

}

Public function mainfunction(paramters)
   {
whatever(parameters)
somethingelse(parameters)
}

}

very roughly speaking.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
if I have something like this, how can I call (i mean the syntax ) to call function call_updater from function test_table_XYZ1()


class MuzeUpdater
{
public function test_table_XYZ1()
{

want to call the private fiuunction

}



private function call_updater()
{
do something here




}

}
 
Code:
class MuzeUpdater
    {
        public function test_table_XYZ1()
        {
            
            [red]call_updater();[/red]
            
        }
        
        
        
            private function call_updater()
        {
                do something here    
            
            


        }

}

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
thanks, don't I have to use this operator, like

$this->call_updater();
 
yeah sorry mi mistake. you need the $this operator.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top