Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
dvprog_14 [2013-05-13 15:03] Daniel Viström |
dvprog_14 [2016-05-10 09:43] Daniel Viström |
||
---|---|---|---|
Line 6: | Line 6: | ||
Attribut | Attribut | ||
Metod | Metod | ||
+ | Arv | ||
+ | |||
+ | [[https:// | ||
==== Exempel 1 ==== | ==== Exempel 1 ==== | ||
Line 98: | Line 101: | ||
// Alla attribut ska vara private eller protected för att kapsla in dem. | // Alla attribut ska vara private eller protected för att kapsla in dem. | ||
// Metoder som ska gå att komma åt utifrån deklareras som public. | // Metoder som ska gå att komma åt utifrån deklareras som public. | ||
- | protected $weight; // Kommer inte åt detta i Dog om det är satt som private. | + | protected $weight; |
- | private $legs; | + | private $legs; |
public function __construct($weight=0){ | public function __construct($weight=0){ | ||
Line 114: | Line 117: | ||
public function getLegs() { | public function getLegs() { | ||
- | return $this-> | + | |
} | } | ||
public function setLegs($legs) { | public function setLegs($legs) { | ||
- | $this-> | + | |
} | } | ||
Line 132: | Line 135: | ||
public function __construct($weight=0){ | public function __construct($weight=0){ | ||
$this-> | $this-> | ||
- | parent:: | + | |
} | } | ||
| |