123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace Juju;
- abstract class Base {
- private $data;
- public function __construct(){
- $this->data = [];
- // Constructor
- }
- public function __clone(){
- // Clone handler
- }
- public function __destruct(){
- // Destroy handler
- $this->data = [];
- }
- public function __toString(){
- $name = get_class($this);
- if(!$name){
- $name = "Object";
- }
- return "[".$name."]";
- }
- public function __invoke($res,$args){
- // Invoke handler
- }
- public function jsonSerialize(){
- return $this;
- }
- public function __get($name){
- return $this->data??null;
- }
- public function __set($name,$value){
- if(isset($this->data[$name])){
- $this->data[$name] = $value;
- }
- }
- public function __isset($name){
- return isset($this->data[$name]);
- }
- public function __unset($name){
- unset($this->data[$name]);
- }
- }
- ?>
|