forked from assembler-institute/oop-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabstExtendClass.php
More file actions
43 lines (31 loc) · 1.1 KB
/
abstExtendClass.php
File metadata and controls
43 lines (31 loc) · 1.1 KB
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
<?php
require_once 'abstClass.php';
class Destination extends Vacation{
protected $strMessage;
protected $destiPlace;
function __construct(string $name, string $lastName, INT $age)
{
parent::__construct( $name, $lastName, $age);
$destiOptions = array('Caribe','Maldives','Barcelona','Fiji','New York', 'Thailand', 'Norway','Hawai');
$randomName = $destiOptions[rand(0,sizeof($destiOptions)-1)];
$this -> destiPlace = $randomName;
}
public function setPromoMessage(string $message){
return $this ->strMessage = $message . '<b>'. $this->destiPlace . '</b>';
}
// Method to GET extended info grouped
public function getWinnerInfo()
{
$data = "
<h3><i>Show Winner Info</i></h3>
<hr>
<b>First Name</b> {$this -> strName} <br>
<b>Last Name</b> {$this -> strLastName} <br>
<b>Age</b> {$this -> intAge} <br>
<b>Destination</b> {$this -> destiPlace} <br>
<b>Message</b> {$this -> strMessage} <br>
";
return $data;
}
}
?>