Skip to content

Instantly share code, notes, and snippets.

@ArtemioVegas
Created July 29, 2017 11:57
Show Gist options
  • Save ArtemioVegas/81edbd6ec37a4a2311b29959acb60b31 to your computer and use it in GitHub Desktop.
Save ArtemioVegas/81edbd6ec37a4a2311b29959acb60b31 to your computer and use it in GitHub Desktop.
Задачи на ООП в PHP. Часть 1_2
<?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;
}
}
<?php
class NewWorker extends User{
private $salary;
public function getSalary()
{
return $this->salary;
}
public function setSalary($salary)
{
$this->salary = $salary;
}
}
<?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;
}
}
<?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