Import source
This commit is contained in:
parent
50b489784d
commit
32b8c4cb56
34 changed files with 890 additions and 0 deletions
48
PatchObject.php
Normal file
48
PatchObject.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
class PatchObject {
|
||||
private $id = '';
|
||||
private $vendor = '';
|
||||
private $product = '';
|
||||
private $version = '';
|
||||
private $url = '';
|
||||
private $timestamp = 0;
|
||||
function __construct(array $arr = array()) {
|
||||
foreach ($arr as $key => $val) {
|
||||
if (property_exists(__CLASS__, $key))
|
||||
$this->{$key} = $val;
|
||||
}
|
||||
}
|
||||
function __toString() : string {
|
||||
return $this->vendor . ' ' . $this->product . ' ' . $this->version;
|
||||
}
|
||||
function toArray() : array {
|
||||
return array('id' => $this->id, 'vendor' => $this->vendor, 'product' => $this->product, 'version' => $this->version, 'url' => $this->url, 'timestamp' => $this->timestamp);
|
||||
}
|
||||
function getId() : string {
|
||||
return $this->id;
|
||||
}
|
||||
function getVendor() : string {
|
||||
return $this->vendor;
|
||||
}
|
||||
function getProduct() : string {
|
||||
return $this->product;
|
||||
}
|
||||
function getVersion() : string {
|
||||
return $this->version;
|
||||
}
|
||||
function setVersion(string $version) {
|
||||
$this->version = $version;
|
||||
}
|
||||
function getURL() : string {
|
||||
return $this->url;
|
||||
}
|
||||
function getTimestamp() : int {
|
||||
return $this->timestamp;
|
||||
}
|
||||
function setTimestamp(int $timestamp) {
|
||||
$this->timestamp = $timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue