I have these two functions:
public function getSales() {
return $this->sales;
}
public function getCommissionRate() {
return $this->commission_rate;
}
I want to multiply the sales and commission in a new method "getEarnings()" so that I can put it into a variable called $earnings
I am not sure how to make the happen. My best idea is:
public function getEarnings() {
return $this->sales * $this->commission_rate = $earnings;
}
Can someone please educate me on how to do this correctly?