text

Text Class provided by System to get Texts from the Database.

package

SYSTEM\PAGE

Methods

Delete a text from the Database.

delete(string $id, string $lang = null) : boolean
static

Arguments

$id

string

Id of the text

$lang

string

Language of the text

Response

boolean

Returns true or false

Get a text with certain id and language

get(string $id, string $lang = NULL, boolean $fallback = true) : string
static

Arguments

$id

string

Id of the text requested

$lang

string

Language for the requested text

$fallback

boolean

Fallback to default language if textid is not found for the specified language.

Response

string

Returns the text if found empty string if not.

Get a text with certain id and language plus creation user info etc

get_adv(string $id, string $lang = NULL, boolean $fallback = true) : \SYSTEM\PAGE\Databaseresult
static

Arguments

$id

string

Id of the text requested

$lang

string

Language for the requested text

$fallback

boolean

Fallback to default language if textid is not found for the specified language.

Response

\SYSTEM\PAGE\Databaseresult

Returns Database Result to loop over.

Get latest texts from database by tag and limit

get_latest(string $tag, integer $limit) : array
static

Arguments

$tag

string

Id of the tag requested

$limit

integer

Amount of Texts to be requested

Response

array

Returns array with texts for given tag ordered by time

Get a tags of a text with certain id and limit the results

get_tags(string $id, integer $limit) : array
static

Arguments

$id

string

Id of the text requested

$limit

integer

Amount of Tags to be requested

Response

array

Returns array with tags for given text id

Get the tags of a textid

id_tags(string $id) : array
static

Arguments

$id

string

textid to be checked upon

Response

array

Returns array with tags for that textid.

Save a text into the Database. Works like rename

save(string $id, string $new_id, string $lang, array $tags, string $text) : boolean
static

Arguments

$id

string

Id of the text

$new_id

string

New Id of the text

$lang

string

Language of the text

$tags

array

Array with tags for that text

$text

string

Text to be saved

Response

boolean

Returns true or false

Get the texts with certain tag and language

tag(string $tag, string $lang = NULL, boolean $fallback = true) : array
static

Arguments

$tag

string

tag to be checked upon

$lang

string

Language for the requested texts

$fallback

boolean

Fallback to default language if certain id is not found for the specified language.

Response

array

Returns array with texts for requested tag.

Get the texts with certain tag and language plus creation user info etc

tag_adv(string $tag, string $lang = NULL, boolean $fallback = true) : array
static

Arguments

$tag

string

tag to be checked upon

$lang

string

Language for the requested texts

$fallback

boolean

Fallback to default language if certain id is not found for the specified language.

Response

array

Returns array with texts for requested tag including usernames etc for the texts

Constants

Entry of a new text temporary used

NEW_ENTRY