src/includes/traits/OverloadMembers.php
protected function overload($properties, bool $writable = false)
    {
        if (is_object($properties)) {
            foreach ($properties as $_property => &$_value) {
                if ($writable) {
                    unset($this->{$_property});
                    unset($this->x___overload_data[$_property]);
                    $this->x___writable_overload_keys[$_property] = 1;
                    $this->{$_property}                           = null;
                    $this->{$_property}                           = &$_value;
                    $this->x___overload_data[$_property]          = &$this->{$_property};
                } else { // NOT writable.
                    unset($this->{$_property});
                    unset($this->x___overload_data[$_property]);
                    unset($this->x___writable_overload_keys[$_property]);
                    $this->x___overload_data[$_property] = &$_value;
                }
            } // unset($_property, $_value);
            return; // Stop now; all done here.
            //
        } elseif (is_array($properties)) {
            foreach ($properties as $_key => $_property) {
                if (!property_exists($this, $_property)) {
                    throw $this->c::issue([], sprintf('No `%1$s` property.', $_property), __METHOD__);
                }
                if ($writable) {
                    unset($this->x___overload_data[$_property]);
                    $this->x___writable_overload_keys[$_property] = -1;
                    $this->x___overload_data[$_property]          = &$this->{$_property};
                } else { // NOT writable.
                    unset($this->x___overload_data[$_property]);
                    unset($this->x___writable_overload_keys[$_property]);
                    $this->x___overload_data[$_property] = &$this->{$_property};
                }
            } // unset($_key, $_property);
            return; // Stop now; all done here.
        }
        throw $this->c::issue([], sprintf('`%1$s`; expecting object/array.', gettype($properties)), __METHOD__);
    }
protected function overload($properties, bool $writable = false)
    {
        if (is_object($properties)) {
            foreach ($properties as $_property => &$_value) {
                if ($writable) {
                    unset($this->{$_property});
                    unset($this->x___overload_data[$_property]);
                    $this->x___writable_overload_keys[$_property] = 1;
                    $this->{$_property}                           = null;
                    $this->{$_property}                           = &$_value;
                    $this->x___overload_data[$_property]          = &$this->{$_property};
                } else { // NOT writable.
                    unset($this->{$_property});
                    unset($this->x___overload_data[$_property]);
                    unset($this->x___writable_overload_keys[$_property]);
                    $this->x___overload_data[$_property] = &$_value;
                }
            } // unset($_property, $_value);
            return; // Stop now; all done here.
            //
        } elseif (is_array($properties)) {
            foreach ($properties as $_key => $_property) {
                if (!property_exists($this, $_property)) {
                    throw $this->c::issue([], sprintf('No `%1$s` property.', $_property), __METHOD__);
                }
                if ($writable) {
                    unset($this->x___overload_data[$_property]);
                    $this->x___writable_overload_keys[$_property] = -1;
                    $this->x___overload_data[$_property]          = &$this->{$_property};
                } else { // NOT writable.
                    unset($this->x___overload_data[$_property]);
                    unset($this->x___writable_overload_keys[$_property]);
                    $this->x___overload_data[$_property] = &$this->{$_property};
                }
            } // unset($_key, $_property);
            return; // Stop now; all done here.
        }
        throw $this->c::issue([], sprintf('`%1$s`; expecting object/array.', gettype($properties)), __METHOD__);
    }
Setup overloads.

@since 150424 Initial release.

@param array|object $properties Property(s).

@internal This will overload properties by reference.
Object properties can be set as writable or not writable.
-
@internal Property names can be overloaded to provide public or JSON access.
Overloaded object property names can be set as writable or not writable.

@param bool $writable Overloaded properties are writable?