-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAuthor.php
More file actions
39 lines (32 loc) · 796 Bytes
/
Author.php
File metadata and controls
39 lines (32 loc) · 796 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
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Author
*
* @author Brad
*/
class Author {
protected $authors = array();
public function getAuthor(){
return $this->authors;
}
public function addAuthor($author){
array_push($this->authors, $author);
return 1;
}
public function removeAuthor($author){
$index = array_search($author, $this->authors);
if ($index == 0){
if ($this->authors[0] != $author){
return 0;
}
}
unset($this->authors[$index]);
$this->authors = array_merge($this->authors);
return 1;
}
}
?>