LogModel::formatKey PHP Method

formatKey() public method

Format a specific column from the log.
public formatKey ( string $Key, array $Data ) : string
$Key string The key in the log row to format.
$Data array The log row.
return string Returns the formatted entry.
    public function formatKey($Key, $Data)
    {
        if (!is_array($Data)) {
            $Data = (array) $Data;
        }
        if (isset($Data['_New'][$Key])) {
            $Old = htmlspecialchars(val($Key, $Data, ''));
            $New = htmlspecialchars($Data['_New'][$Key]);
            $Result = $this->formatDiff($Old, $New);
        } else {
            $Result = htmlspecialchars(val($Key, $Data, ''));
        }
        return nl2br(trim($Result));
    }