forked from thoth-pub/thoth-client-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPublication.php
More file actions
171 lines (137 loc) · 4.34 KB
/
Publication.php
File metadata and controls
171 lines (137 loc) · 4.34 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
namespace ThothApi\GraphQL\Models;
class Publication extends AbstractModel
{
public const PUBLICATION_TYPE_PAPERBACK = 'PAPERBACK';
public const PUBLICATION_TYPE_HARDBACK = 'HARDBACK';
public const PUBLICATION_TYPE_PDF = 'PDF';
public const PUBLICATION_TYPE_HTML = 'HTML';
public const PUBLICATION_TYPE_XML = 'XML';
public const PUBLICATION_TYPE_EPUB = 'EPUB';
public const PUBLICATION_TYPE_MOBI = 'MOBI';
public const PUBLICATION_TYPE_AZW3 = 'AZW3';
public const PUBLICATION_TYPE_DOCX = 'DOCX';
public const PUBLICATION_TYPE_FICTION_BOOK = 'FICTION_BOOK';
public const PUBLICATION_TYPE_MP3 = 'MP3';
public const PUBLICATION_TYPE_WAV = 'WAV';
public function getPublicationId(): ?string
{
return $this->getData('publicationId');
}
public function setPublicationId(?string $publicationId): void
{
$this->setData('publicationId', $publicationId);
}
public function getWorkId(): ?string
{
return $this->getData('workId');
}
public function setWorkId(?string $workId): void
{
$this->setData('workId', $workId);
}
public function getPublicationType(): ?string
{
return $this->getData('publicationType');
}
public function setPublicationType(?string $publicationType): void
{
$this->setData('publicationType', $publicationType);
}
public function getIsbn(): ?string
{
return $this->getData('isbn');
}
public function setIsbn(?string $isbn): void
{
$this->setData('isbn', $isbn);
}
public function getWidthMm(): ?float
{
return $this->getData('widthMm');
}
public function setWidthMm(?float $widthMm, bool $convert = false): void
{
$this->setData('widthMm', $widthMm);
if ($convert) {
$this->setData('widthIn', $widthMm ? round($widthMm / 25.4, 2) : null);
}
}
public function getWidthIn(): ?float
{
return $this->getData('widthIn');
}
public function setWidthIn(?float $widthIn, bool $convert = false): void
{
$this->setData('widthIn', $widthIn);
if ($convert) {
$this->setData('widthMm', $widthIn ? round($widthIn * 25.4, 2) : null);
}
}
public function getHeightMm(): ?float
{
return $this->getData('heightMm');
}
public function setHeightMm(?float $heightMm, bool $convert = false): void
{
$this->setData('heightMm', $heightMm);
if ($convert) {
$this->setData('heightIn', $heightMm ? round($heightMm / 25.4, 2) : null);
}
}
public function getHeightIn(): ?float
{
return $this->getData('heightIn');
}
public function setHeightIn(?float $heightIn, bool $convert = false): void
{
$this->setData('heightIn', $heightIn);
if ($convert) {
$this->setData('heightMm', $heightIn ? round($heightIn * 25.4, 2) : null);
}
}
public function getDepthMm(): ?float
{
return $this->getData('depthMm');
}
public function setDepthMm(?float $depthMm, bool $convert = false): void
{
$this->setData('depthMm', $depthMm);
if ($convert) {
$this->setData('depthIn', $depthMm ? round($depthMm / 25.4, 2) : null);
}
}
public function getDepthIn(): ?float
{
return $this->getData('depthIn');
}
public function setDepthIn(?float $depthIn, bool $convert = false): void
{
$this->setData('depthIn', $depthIn);
if ($convert) {
$this->setData('depthMm', $depthIn ? round($depthIn * 25.4, 2) : null);
}
}
public function getWeightG(): ?float
{
return $this->getData('weightG');
}
public function setWeightG(?float $weightG, bool $convert = false): void
{
$this->setData('weightG', $weightG);
if ($convert) {
$this->setData('weightOz', $weightG ? round($weightG / 28.349523125, 4) : null);
}
}
public function getWeightOz(): ?float
{
return $this->getData('weightOz');
}
public function setWeightOz(?float $weightOz, bool $convert = false): void
{
$this->setData('weightOz', $weightOz);
if ($convert) {
$this->setData('weightG', $weightOz ? round($weightOz * 28.349523125, 4) : null);
}
}
}