I am a bit new to OOP although I have been coding procedural PHP for years.

Here is what I am trying to figure out.

Say I have several classes and I want to call on a function from one of those classes inside a function in the other classes. What is the best way to do this? Do I have to extend them all from the first one, that seems like it would get really confusing if I have 8-10 different classes.

Below is a scenario of something similar to what I would like to do.

PHP Code:
class History
{           
          public function 
setHistory()
          {
               
$sql "insert into history (some columns here) values (some values here)";
               
$result mysql_query($sql);
          }
}


class 
Tasks
{
          public function 
updateTask()
          {
               
$result mysql_query("update task set subject = "testing" where task_id = $this->task_id ");
               
$setHistory();   //TRYING TO CALL FUNCTION FROM OTHER CLASS
          
}
}


class 
Contact
{
          public function 
updateContact()
          {
              
$result mysql_query("update contact set first_name = "John" where contact_id = $this->contact_id ");
              
$setHistory();   //AGAIN IM TRYING TO CALL FUNCTION FROM OTHER CLASS
          
}

So I might want to put data into the history table from all the other classes but I don't really want to have to build a function inside each and every class that does the same thing.

Any help would be very much appreciated.