diff --git a/_includes/Mic.class.php b/_includes/Mic.class.php index 42e49bc68776c9865caa1199b888e790a3502697..933932a651e09da31fed14d53fe6393b364a4fe5 100644 --- a/_includes/Mic.class.php +++ b/_includes/Mic.class.php @@ -10,7 +10,8 @@ class Mic public $price; // Creating methods.. - public function setLight($light){ + public function setLight($light) + { print($light);//Returns parameter's value // $this keyword is used to specify the variable inside class. @@ -18,36 +19,48 @@ class Mic } // Call and change model name to first word as uppercase - public function setModel($model){ + public function setModel($model) + { // Store $model values to model with $this. - $this -> model = ucwords($model); //ucwords() converts 1st letter string as uppercase. + $this -> model = \ucwords($model); //ucwords() converts 1st letter string as uppercase. return $this-> model; } // To print the $model as output: - public function getModel(){ + public function getModel() + { print($this-> model); } - // To set value to $color with private method - private function setColor($color){ + // To set value to $color with private method + private function setColor($color) + { $this -> color = $color; } - + // To display the value with private method - private function getColor(){ + private function getColor() + { return $this -> color; } // Accessing private method with public method to get value from test.php - public function setColorProxy($color){ + public function setColorProxy($color) + { $this -> setColor($color); } // Getting values from private method -> private propertiy: to display value to test.php - public function getColorProxy(){ + public function getColorProxy() + { return $this -> getColor(); } + + public function __destruct() + { + print("I am from Destructor....!". $this -> brand); + } + }