From 0ea277ee191cb05af6a908f4fbb6c791f4058260 Mon Sep 17 00:00:00 2001 From: LogMANOriginal Date: Sat, 5 Nov 2016 19:34:56 +0100 Subject: [PATCH] [FormatAbstract] Add new page --- FormatAbstract.md | 92 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 FormatAbstract.md diff --git a/FormatAbstract.md b/FormatAbstract.md new file mode 100644 index 0000000..4c632f4 --- /dev/null +++ b/FormatAbstract.md @@ -0,0 +1,92 @@ +The `FormatAbstract` class implements the [`FormatInterface`](FormatInterface) interface with basic functional behavior and adds common helper functions for new formats: + +* [setCharset](#the-setcharset-function) +* [getCharset](#the-getcharset-function) +* [setContentType](#the-setcontenttype-function) +* [callContentType](#the-callcontenttype-function) +* [getItems](#the-getitems-function) +* [setExtraInfos](#the-setextrainfos-function) +* [getExtraInfos](#the-getextrainfos-function) +* [sanitizeHtml](#the-sanitizehtml-function) +* [array_trim](#the-array_trim-function) + +#Functions + +#The `setCharset` function + +The `setCharset` function receives the character set value as string and returns the object instance. + +```PHP +setCharset(string): self +``` + +#The `getCharset` function + +The `getCharset` function returns the character set value. + +```PHP +getCharset(): string +``` + +#The `setContentType` function + +The `setContentType` function receives a string defining the content type for the HTML header and must return the object instance. + +```PHP +setContentType(string): self +``` + +#The `callContentType` function + +The `callContentType` function applies the content type to the header data and must return the object instance. + +```PHP +callContentType(): self +``` + +#The `getItems` function + +The `getItems` function returns the items previously set by the [`setItems`](FormatInterface#the-setitems-function) function. If no items where set previously this function returns an error. + +```PHP +getItems(): array +``` + +#The `setExtraInfos` function + +The `setExtraInfos` function receives an array of elements with additional information to generate format outputs and must return the object instance. + +```PHP +setExtraInfos(array $infos): self +``` + +Currently supported information are: + +Name | Description +-----|------------ +`name` | Defines the name as generated by the bridge +`uri` | Defines the URI of the feed as generated by the bridge + +#The `getExtraInfos` function + +The `getExtraInfos` function returns the information previously set via the [`setExtraInfos`](#the-setextrainfos-function) function. + +```PHP +getExtraInfos(): array +``` + +#The `sanitizeHtml` function + +The `sanitizeHtml` function receives an HTML formatted string and returns the string with disabled `