object = (object) $object; return $this; } public function offsetExists($offset): bool { if ($this->checkRequireAdmin($offset)) { return false; } return parent::offsetExists($offset); } public function offsetGet($offset): mixed { if ($this->checkRequireAdmin($offset)) { return false; } return parent::offsetGet($offset); } public function checkRequireAdmin($offset) { if (strpos($offset, '_adminSetter') === false && !getAdminUser() && !empty($this->{$offset.'_adminSetter'}) && $this->{$offset.'_adminSetter'} == 'Y') { return true; } return false; } public function jsonSerialize(): mixed { return $this->getObject(); } }