mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-12-25 13:08:58 +00:00
Created APIClient object
This commit is contained in:
parent
459916721f
commit
63f6333bad
59
classes/models/APIClient.php
Normal file
59
classes/models/APIClient.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* API Client
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
//This class requires the BaseUniqueObject class to be loaded
|
||||
require_once __DIR__."/BaseUniqueObject.php";
|
||||
|
||||
class APIClient extends BaseUniqueObject {
|
||||
|
||||
//Private fields
|
||||
private $name;
|
||||
private $token;
|
||||
private $url;
|
||||
|
||||
//Get and set client name
|
||||
public function set_name(string $name){
|
||||
$this->name = $name == "" ? null : $name;
|
||||
}
|
||||
|
||||
public function has_name() : bool {
|
||||
return $this->name != null;
|
||||
}
|
||||
|
||||
public function get_name() : string {
|
||||
return $this->name != null ? $this->name : "null";
|
||||
}
|
||||
|
||||
|
||||
//Get and set client token
|
||||
public function set_token(string $token){
|
||||
$this->token = $token == "" ? null : $token;
|
||||
}
|
||||
|
||||
public function has_token() : bool {
|
||||
return $this->token != null;
|
||||
}
|
||||
|
||||
public function get_token() : string {
|
||||
return $this->token != null ? $this->token : "null";
|
||||
}
|
||||
|
||||
|
||||
//Get and set client URL
|
||||
public function set_url(string $url){
|
||||
$this->url = $url == "" ? null : $url;
|
||||
}
|
||||
|
||||
public function has_url() : bool {
|
||||
return $this->url != null;
|
||||
}
|
||||
|
||||
public function get_url() : string {
|
||||
return $this->url != null ? $this->url : "null";
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user