-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBook.php
More file actions
145 lines (124 loc) · 2.93 KB
/
Copy pathBook.php
File metadata and controls
145 lines (124 loc) · 2.93 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Book
*
* @author Brad
*/
require_once 'Publisher.php';
require_once 'Author.php';
class Book {
//put your code here
protected $authors;
protected $publishers;
protected $name;
protected $isbn;
protected $volume_id;
protected $page_count;
protected $description;
protected $quantity;
protected $available;
protected $thumbnailLink;
public function __construct() {
$this->authors = new Author();
$this->publishers = new Publisher();
}
public function getThumbnailLink()
{
return $this->thumbnailLink;
}
public function getNumAvailable(){
return $this->available;
}
public function getVolumeID() {
return $this->volume_id;
}
public function getAuthor(){
return $this->authors;
}
public function setAuthor($pAuthorObject)
{
$this->authors = $pAuthorObject;
}
public function getPublisher(){
return $this->publishers;
}
public function setPublisher($pPublisherObject)
{
$this->publishers = $pPublisherObject;
}
public function getName(){
return $this->name;
}
public function setName($newName){
$this->name = $newName;
return 1;
}
public function setThumbnailLink($pLink)
{
$this->thumbnailLink = $pLink;
}
public function getISBN(){
return $this->isbn;
}
public function setISBN($newisbn){
$this->isbn = $newisbn;
return 1;
}
public function getPCount(){
return $this->page_count;
}
public function setPCount($pcount){
$this->page_count = $pcount;
return 1;
}
public function getDescription(){
return $this->description;
}
public function setDescription($newDesc){
$this->description = $newDesc;
return 1;
}
public function getQuantity(){
return $this->quantity;
}
public function setQuantity($newQuant){
$this->quantity = $newQuant;
return 1;
}
public function setVolumeID($pVolID){
$this->volume_id = $pVolID;
return 1;
}
public function setNumAvailable($pNA){
$this->available = $pNA;
return 1;
}
public function __toString()
{
$returnString = "";
$returnString .= sprintf("Title: %s\n", $this->name);
$returnString .= sprintf("ISBN: %s\n", $this->isbn);
$returnString .= sprintf("Volume ID: %s\n", $this->volume_id);
$returnString .= sprintf("Quantity: %s\n", $this->quantity);
$returnString .= sprintf("Page Count: %s\n", $this->page_count);
$returnString .= sprintf("Publish Date: %s\n", $this->publishers->getPublishDate());
$count = 1;
foreach($this->authors->getAuthor() as $author)
{
$returnString .= sprintf("Author %d: %s\n", $count, $author);
$count++;
}
$count = 1;
foreach($this->publishers->getPublisher() as $publisher)
{
$returnString .= sprintf("Publisher %d: %s\n", $count, $publisher);
$count ++;
}
return $returnString;
}
}
?>