src/JsonModel.php
public function jsonSerialize() {
        $data = new stdClass();
        $vars = get_object_vars($this);

        foreach ($vars as $property => $value) {
            if ($value === null) {
                continue;
            }

            $data->{$property} = $value;
        }

        return $data;
    }
public function jsonSerialize() {
        $data = new stdClass();
        $vars = get_object_vars($this);

        foreach ($vars as $property => $value) {
            if ($value === null) {
                continue;
            }

            $data->{$property} = $value;
        }

        return $data;
    }
public function jsonSerialize ( ) { $ data = new stdClass ( ) ; $ vars = get_object_vars ( $ this ) ; foreach ( $ vars as $ property => $ value ) { if ( $ value === null ) { continue ; } $ data -> { $ property } = $ value ; } return $ data ; }
Get data for JSON serialization.

Properties set to NULL will be omitted from the output.

@return string
Get data for JSON serialization .