-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlog.php
27 lines (21 loc) · 972 Bytes
/
Blog.php
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
<?php
class Blog {
private array $blogContent;
private string $owner;
private string $bio;
public function __construct(string $ownerName, string $bio) {
$this->blogContent = array();
$this->owner = $ownerName;
$this->bio = $bio;
}
public function getOwner() { return $this->owner; }
public function getBio() { return $this->bio; }
public function getContent() { return $this->blogContent; }
public function messageByIndex(int $index) { return $this->blogContent[$index]; }
public function setOwner(string $ownerName) { $this->owner = $ownerName; }
public function setBio(string $bio) { $this->bio = $bio; }
public function loadContent(array $messagesList) { $this->blogContent = $messagesList; }
public function uploadMessage(string|array $message) { array_push($this->blogContent, $message); }
public function removeMessageByIndex(int $index) { unset($this->blogContent, $index); }
}
?>