-
Notifications
You must be signed in to change notification settings - Fork 1
/
Publisher.php
49 lines (41 loc) · 1.07 KB
/
Publisher.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Publisher
*
* @author Brad
*/
class Publisher {
protected $publishers = array();
protected $publish_date = 0;
public function addPublisher($publisher){
array_push($this->publishers, $publisher);
return 1;
}
public function removePublisher($publisher){
$index = 0;
$index = array_search($publisher, $this->publishers);
if ($index == 0){
if ($this->publishers[0] != $publisher){
return 0;
}
}
unset($this->publishers[$index]);
$this->publishers = array_merge($this->publishers);
return 1;
}
public function getPublisher(){
return $this->publishers;
}
public function setPublishDate($date){
$this->publish_date = $date;
return 1;
}
public function getPublishDate(){
return $this->publish_date;
}
}
?>