ENHANCE:MENT: Added binary data methods

This commit is contained in:
Jeroen De Meerleer 2023-01-21 15:55:36 +01:00
parent 58ff6714a9
commit 2758cb436d
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 27 additions and 0 deletions

View File

@ -70,4 +70,31 @@ class Pairing
* @var int
*/
public $Round;
/**
* Magic method to read out several fields. If field was not found it is being searched in the binary data fields
*
* @param string $key
*
* @return bool|DateTime|int|string|null
*/
public function __get(string $key)
{
if (isset($this->BinaryData[ $key ])) {
return $this->BinaryData[ $key ];
}
return null;
}
/**
* Sets binary data that is read out the pairing file but is not needed immediately
*
* @param string $key
* @param bool|int|DateTime|string $value
*/
public function __set(string $key, $value): void
{
$this->BinaryData[ $key ] = $value;
}
}