Created
July 29, 2017 11:57
-
-
Save ArtemioVegas/81edbd6ec37a4a2311b29959acb60b31 to your computer and use it in GitHub Desktop.
Задачи на ООП в PHP. Часть 1_2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Driver extends NewWorker{ | |
private $drivingExperience; | |
private $drivingCategory; | |
public function getDrivingExperience() | |
{ | |
return $this->drivingExperience; | |
} | |
public function setDrivingExperience($drivingExperience) | |
{ | |
$this->drivingExperience = $drivingExperience; | |
} | |
public function getDrivingCategory() | |
{ | |
return $this->drivingCategory; | |
} | |
public function setDrivingCategory($drivingCategory) | |
{ | |
$this->drivingCategory = $drivingCategory; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class NewWorker extends User{ | |
private $salary; | |
public function getSalary() | |
{ | |
return $this->salary; | |
} | |
public function setSalary($salary) | |
{ | |
$this->salary = $salary; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Student extends User{ | |
private $grants; | |
private $course | |
public function getGrants() | |
{ | |
return $this->grants; | |
} | |
public function setGrants($grants) | |
{ | |
$this->grants = $grants; | |
} | |
public function getCourse() | |
{ | |
return $this->course; | |
} | |
public function setCourse($course) | |
{ | |
$this->course = $course; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User{ | |
protected $name; | |
protected $age; | |
public function getName($name,$age,$salary) | |
{ | |
return $this->name; | |
} | |
public function setName($name) | |
{ | |
$this->name = $name; | |
} | |
public function getAge() | |
{ | |
return $this->age; | |
} | |
public function setAge($age) | |
{ | |
$this->age = $age; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment