forked from assembler-institute/oop-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path17-ClassDogs.php
More file actions
58 lines (43 loc) · 947 Bytes
/
17-ClassDogs.php
File metadata and controls
58 lines (43 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
Class Dogs {
public string $name = "";
public string $breed = "";
public int $age = 0;
public function __construct ( string $name1, string $breed1, int $age1) {
$this -> name = $name1;
$this -> breed = $breed1;
$this->age = $age1;
}
public function getDogsData() {
$data = "
<h2> Data Dogs </h2>
Name : {$this->name}<br>
Breed : {$this ->breed}<br>
Age : {$this->age}<br>
";
return $data;
}
}
/* 3 methods Formats !!!
public function setName () {
return $this -> name;
}
public function getName ($name) {
$this -> name = $name;
return $this -> name;
}
public function setBreed () {
return $this -> breed;
}
public function getBreed ($breed) {
$this -> breed = $breed;
return $this;
}
public function setAge () {
return $this -> age;
}
public function getAge ($age) {
$this -> age = $age;
return $this;
} */
?>