duckbrain/src/Libs/Params.php

26 lines
469 B
PHP
Raw Normal View History

2020-03-08 04:37:19 +01:00
<?php
namespace Libs;
class Params {
2020-03-14 03:41:48 +01:00
private $data;
2020-03-08 04:37:19 +01:00
public function __construct($args){
2020-03-14 03:41:48 +01:00
$this->data = [];
2020-03-08 04:37:19 +01:00
foreach($args as $index => $value){
2020-03-14 03:41:48 +01:00
$this->data[$index] = $value;
2020-03-08 04:37:19 +01:00
}
}
2020-03-17 03:54:12 +01:00
public function __isset($index) {
return isset($this->data[$index]);
}
2020-03-08 04:37:19 +01:00
public function __get($index){
return (isset($this->data[$index]) && $this->data[$index] != '') ? $this->data[$index] : null;
2020-03-08 04:37:19 +01:00
}
}
?>