src/MVQN/REST/RestObject.php
public function jsonSerialize()
    {
        // Get an array of all Model properties.
        $assoc = get_object_vars($this);

        // Move ID to the first element in the array for readability.
        if(array_key_exists("id", $assoc))
            $assoc = ["id" => $assoc["id"]] + $assoc;

        // Return the array!
        return $assoc;
    }
public function jsonSerialize()
    {
        // Get an array of all Model properties.
        $assoc = get_object_vars($this);

        // Move ID to the first element in the array for readability.
        if(array_key_exists("id", $assoc))
            $assoc = ["id" => $assoc["id"]] + $assoc;

        // Return the array!
        return $assoc;
    }
Specify data which should be serialized to JSON.

@link http://php.net/manual/en/jsonserializable.jsonserialize.php
@return mixed Data which can be serialized by <b>json_encode</b>, as a value of any type other than a resource.
@since 5.4.0