68 lines
1.1 KiB
PHP
68 lines
1.1 KiB
PHP
<?php
|
|
|
|
class Person
|
|
{
|
|
protected string $Nname;
|
|
protected string $Vname;
|
|
|
|
|
|
public function __construct(string $nach, string $vor)
|
|
{
|
|
$this->Nname = $nach;
|
|
$this->Vname = $vor;
|
|
}
|
|
|
|
public function setName(string $nach): void
|
|
{
|
|
$this->Nname = $nach;
|
|
}
|
|
|
|
public function getName()
|
|
{
|
|
return $this->Nname;
|
|
}
|
|
|
|
public function setVorname(string $vor): void
|
|
{
|
|
$this->Vname = $vor;
|
|
}
|
|
|
|
public function getVorname()
|
|
{
|
|
return $this->Vname;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
class Mitarbeiter extends Person
|
|
{
|
|
private int $gruppierung = 0;
|
|
private int $steuerklasse = 0;
|
|
private int $kontonummer = 0;
|
|
|
|
}
|
|
|
|
|
|
class Kunde extends Person
|
|
{
|
|
private int $bonitaet = 0;
|
|
|
|
public function setBonitaet(int $wert): void
|
|
{
|
|
$this->bonitaet = $wert;
|
|
}
|
|
|
|
public function getBonitaet()
|
|
{
|
|
return $this->bonitaet;
|
|
}
|
|
}
|
|
|
|
|
|
var_dump($strom = new Person("Fischer", "Fritz"));
|
|
|
|
var_dump($strom = new Mitarbeiter("Schulze","Maria"));
|
|
|
|
var_dump($strom = new Kunde("Fähnrich", "Timon"));
|
|
?>
|