FOF30\Model\DataModel::toJson PHP 메소드

toJson() 공개 메소드

Returns the record's data as a JSON string
public toJson ( boolean $prettyPrint = false ) : string
$prettyPrint boolean Should I format the JSON for pretty printing
리턴 string
    public function toJson($prettyPrint = false)
    {
        if (defined('JSON_PRETTY_PRINT')) {
            $options = $prettyPrint ? JSON_PRETTY_PRINT : 0;
        } else {
            $options = 0;
        }
        return json_encode($this->recordData, $options);
    }