class Content

Represents a single content object.

Content objects are the base data class for Tuskfish CMS. The 'type' property determines the template that will be used to display the object, and some aspects of its behaviour.

Traits

Provides definition of permitted content object types.
Provides common access to system languages.
Adds support for HTML meta properties to object.
Provides a list of common (permitted) mimetypes for file uploads.
Resize and cache copies of image files to allow them to be used at different sizes in templates.
Provides a common list of intellectual property rights licenses.
Tag
Add tag support to an object, typically an entity.
Validates that a filename or path does NOT contain directory traversals in any form.
Provides methods for validating UTF-8 character encoding and string composition.

Methods

array
listTemplates()

Returns a list of template names used by specific content types.

array
listTypes()

Returns a whitelist of permitted content object types.

array
listLanguages()

Returns a list of languages in use by the system.

from Language
string
metaTitle()

Return meta title.

from Metadata
setMetaTitle(string $metaTitle)

Set meta title.

from Metadata
string
metaDescription()

Return meta description.

from Metadata
setMetaDescription(string $metaDescription)

Set meta description.

from Metadata
string
metaSeo()

Return SEO-friendly string.

from Metadata
setMetaSeo(string $metaSeo)

Set SEO-friendly string

from Metadata
array
listAudioMimetypes()

Return a list of permitted audio mimetypes and extensions.

from Mimetypes
array
listImageMimetypes()

Return a list of permitted image mimetypes and extensions.

from Mimetypes
array
listVideoMimetypes()

Return a list of permitted video mimetypes and extensions.

from Mimetypes
array
listMimetypes()

Returns an array of mimetypes that are permitted for upload to the media directory.

from Mimetypes
string
cachedImage(int $width = 0, int $height = 0)

Resizes and caches an associated image and returns a URL to the cached copy.

array
listRights()

Returns a list of intellectual property rights licenses for the content submission form.

from Rights
array
tags()

Return tags.

from Tag
setTags(array $tags)

Set tags.

from Tag
bool
hasTraversalorNullByte(string $path)

Check if a file path contains traversals (including encoded traversals) or null bytes.

string
encodeEscapeUrl(string $url)

URL-encode and escape a query string for use in a URL.

bool
isAlnum(string $alnum)

Check that a string is comprised solely of alphanumeric characters.

bool
isAlnumUnderscore(string $alnumUnderscore)

Check that a string is comprised solely of alphanumeric characters and underscores.

bool
isAlpha(string $alpha)

Check that a string is comprised solely of alphabetical characters.

bool
isUtf8(string $text)

Check if the character encoding of text is UTF-8.

string
trimString(mixed $text)

Cast to string, check UTF-8 encoding and strip trailing whitespace and control characters.

__get($property)

Magic get access is to support the Tree class - better to refactor it.

load(array $row, bool $convertUrlToConstant = true)

Load properties.

string
bytesToHumanReadable(int $bytes)

Converts bytes to a human readable units (KB, MB, GB etc).

convertBaseUrlToConstant(string $html, bool $convertToConstant = false)

Convert the site base URL to the TFISH_LINK constant and vice versa.

string
url(string $customRoute = '')

Return a URL (permalink) to a content object.

int
id()

Return ID.

setId(int $id)

Set ID

string
title()

Return title.

setTitle(string $title)

Set title

string
type()

Return type of content object.

setType(string $type)

Set type.

string
teaser()

Return teaser.

string
teaserForDisplay()

Return teaser with TFISH_LINK constant converted to URL.

setTeaser(string $teaser)

Set teaser.

string
description()

Return description.

string
descriptionForDisplay()

Return description with TFISH_LINK constant converted to URL.

setDescription(string $description)

Set description.

string
creator()

Return creator.

setCreator(string $creator)

Set creator.

string
media()

Return media file name.

setMedia(string $filename)

Set media file name.

string
extension()

Return file extension.

string
format()

Return format (mimetype).

setFormat(string $format)

Set format.

string
fileSize()

Return file size of media attachment.

setFileSize(int $fileSize)

Set file size of media attachment.

string
image()

Return image name.

setImage(string $filename)

Set image.

string
caption()

Return caption of image.

setCaption(string $caption)

Set caption.

date()

Return date as a DateTime object that can be manipulated.

setDate(string $date)

Set date.

string
info()

Return meta information about content object.

int
submissionTime()

Return submission time.

setSubmissionTime(int $timestamp)

Set submission time.

int
lastUpdated()

Return last modification time.

setLastUpdated(int $timestamp)

Set last updated time.

int
expiresOn()

Return expiry date.

setExpiresOn(int $timestamp)

Set expiry time.

int
counter()

Return view/download counter.

setCounter(int $counter)

Set view/download counter.

int
onlineStatus()

Return online status.

setOnlineStatus(int $status)

Set online status.

int
parent()

Return parent ID.

setParent(int $parent)

Set parent.

string
language()

Return language.

setLanguage(string $language)

Set language.

int
rights()

Return rights.

setRights(int $rights)

Set rights.

string
publisher()

Return publisher.

setPublisher(string $publisher)

Set publisher.

string
module()

Return module.

setModule(string $module)

Set module.

Details

in ContentTypes at line 36
array listTemplates()

Returns a list of template names used by specific content types.

Return Value

array Array of type-template key values.

in ContentTypes at line 62
array listTypes()

Returns a whitelist of permitted content object types.

Use this whitelist when dynamically instantiating content objects. If you create additional types of content object (which must be descendants of the TfContentObject class) you must add them to the whitelist below. Otherwise their use will be denied in many parts of the Tuskfish system.

Return Value

array Array of whitelisted (permitted) content object types.

in Language at line 42
array listLanguages()

Returns a list of languages in use by the system.

In the interests of brevity and sanity a full list is not provided. Add entries that you want to use to the array using ISO 639-1 two-letter language codes, which you can find at: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes. Be aware that deleting entries that are in use by your content objects will cause errors.

Return Value

array Array of languages in ISO 639-1 code => name format.

in Metadata at line 45
string metaTitle()

Return meta title.

Used to set the meta tag.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setMetaTitle"> <div class="location">in <a href="../../../Tfish/Traits/Metadata.html#method_setMetaTitle"><abbr title="Tfish\Traits\Metadata">Metadata</abbr></a> at line 55</div> <code> <strong>setMetaTitle</strong>(string $metaTitle) </code> </h3> <div class="details"> <div class="method-description"> <p>Set meta title.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$metaTitle</td> <td>Populates the <title> tag.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_metaDescription"> <div class="location">in <a href="../../../Tfish/Traits/Metadata.html#method_metaDescription"><abbr title="Tfish\Traits\Metadata">Metadata</abbr></a> at line 67</div> <code> string <strong>metaDescription</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return meta description.</p> <p>Used to set the <meta name="description"> tag.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setMetaDescription"> <div class="location">in <a href="../../../Tfish/Traits/Metadata.html#method_setMetaDescription"><abbr title="Tfish\Traits\Metadata">Metadata</abbr></a> at line 77</div> <code> <strong>setMetaDescription</strong>(string $metaDescription) </code> </h3> <div class="details"> <div class="method-description"> <p>Set meta description.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$metaDescription</td> <td>HTML description of this content.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_metaSeo"> <div class="location">in <a href="../../../Tfish/Traits/Metadata.html#method_metaSeo"><abbr title="Tfish\Traits\Metadata">Metadata</abbr></a> at line 90</div> <code> string <strong>metaSeo</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return SEO-friendly string.</p> <p>This is an SEO-friendly text fragment that can be appended to URLs. It does not affct URL function in any way, since Tuskfish never uses it as a parameter.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setMetaSeo"> <div class="location">in <a href="../../../Tfish/Traits/Metadata.html#method_setMetaSeo"><abbr title="Tfish\Traits\Metadata">Metadata</abbr></a> at line 100</div> <code> <strong>setMetaSeo</strong>(string $metaSeo) </code> </h3> <div class="details"> <div class="method-description"> <p>Set SEO-friendly string</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$metaSeo</td> <td>SEO text to append to URL.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_listAudioMimetypes"> <div class="location">in <a href="../../../Tfish/Traits/Mimetypes.html#method_listAudioMimetypes"><abbr title="Tfish\Traits\Mimetypes">Mimetypes</abbr></a> at line 36</div> <code> array <strong>listAudioMimetypes</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return a list of permitted audio mimetypes and extensions.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_listImageMimetypes"> <div class="location">in <a href="../../../Tfish/Traits/Mimetypes.html#method_listImageMimetypes"><abbr title="Tfish\Traits\Mimetypes">Mimetypes</abbr></a> at line 51</div> <code> array <strong>listImageMimetypes</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return a list of permitted image mimetypes and extensions.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_listVideoMimetypes"> <div class="location">in <a href="../../../Tfish/Traits/Mimetypes.html#method_listVideoMimetypes"><abbr title="Tfish\Traits\Mimetypes">Mimetypes</abbr></a> at line 65</div> <code> array <strong>listVideoMimetypes</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return a list of permitted video mimetypes and extensions.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_listMimetypes"> <div class="location">in <a href="../../../Tfish/Traits/Mimetypes.html#method_listMimetypes"><abbr title="Tfish\Traits\Mimetypes">Mimetypes</abbr></a> at line 85</div> <code> array <strong>listMimetypes</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Returns an array of mimetypes that are permitted for upload to the media directory.</p> <p>NOTE: Adding HTML or any other scripting language or executable to this list would be a BAD IDEA, as such files can include PHP code, although uploaded files have execution permissions removed and are stored outside of the web root in order to prevent direct access by browser.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td>Array of permitted mimetypes and extensions.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_cachedImage"> <div class="location">in <a href="../../../Tfish/Traits/ResizeImage.html#method_cachedImage"><abbr title="Tfish\Traits\ResizeImage">ResizeImage</abbr></a> at line 48</div> <code> string <strong>cachedImage</strong>(int $width = 0, int $height = 0) </code> </h3> <div class="details"> <div class="method-description"> <p>Resizes and caches an associated image and returns a URL to the cached copy.</p> <p>Allows arbitrary sized thumbnails to be produced from the object's image property. These are saved in the cache for future lookups. Image proportions are always preserved, so if both width and height are specified, the larger dimension will take precedence for resizing and the other will be ignored.</p> <p>Usually, you want to produce an image of a specific width or (less commonly) height to meet a template/presentation requirement.</p> <p>Requires GD library.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$width</td> <td>Width of the cached image output.</td> </tr> <tr> <td>int</td> <td>$height</td> <td>Height of the cached image output.</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$url URL to the cached image.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_listRights"> <div class="location">in <a href="../../../Tfish/Traits/Rights.html#method_listRights"><abbr title="Tfish\Traits\Rights">Rights</abbr></a> at line 41</div> <code> array <strong>listRights</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Returns a list of intellectual property rights licenses for the content submission form.</p> <p>In the interests of brevity and sanity, a comprehensive list is not provided. Add entries that you want to use to the array below. Be aware that deleting entries that are in use by your content objects will cause errors.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td>Array of copyright licenses.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_tags"> <div class="location">in <a href="../../../Tfish/Traits/Tag.html#method_tags"><abbr title="Tfish\Traits\Tag">Tag</abbr></a> at line 39</div> <code> array <strong>tags</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return tags.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>array</td> <td>IDs of tags.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setTags"> <div class="location">in <a href="../../../Tfish/Traits/Tag.html#method_setTags"><abbr title="Tfish\Traits\Tag">Tag</abbr></a> at line 49</div> <code> <strong>setTags</strong>(array $tags) </code> </h3> <div class="details"> <div class="method-description"> <p>Set tags.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>array</td> <td>$tags</td> <td>Tag IDs.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_hasTraversalorNullByte"> <div class="location">in <a href="../../../Tfish/Traits/TraversalCheck.html#method_hasTraversalorNullByte"><abbr title="Tfish\Traits\TraversalCheck">TraversalCheck</abbr></a> at line 46</div> <code> bool <strong>hasTraversalorNullByte</strong>(string $path) </code> </h3> <div class="details"> <div class="method-description"> <p>Check if a file path contains traversals (including encoded traversals) or null bytes.</p> <p>Directory traversals are not permitted in Tuskfish method parameters. If a path is found to contain a traversal it is presumed to be an attack. Encoded traversals are a clear sign of attempted abuse.</p> <p>In general untrusted data should never be used to construct a file path. This method exists as a second line safety measure.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$path</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td>True if a traversal or null byte is found, otherwise false.</td> </tr> </table> <h4>See also</h4> <table class="table table-condensed"> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_encodeEscapeUrl"> <div class="location">in <a href="../../../Tfish/Traits/ValidateString.html#method_encodeEscapeUrl"><abbr title="Tfish\Traits\ValidateString">ValidateString</abbr></a> at line 41</div> <code> string <strong>encodeEscapeUrl</strong>(string $url) </code> </h3> <div class="details"> <div class="method-description"> <p>URL-encode and escape a query string for use in a URL.</p> <p>Trims, checks for UTF-8 compliance, rawurlencodes and then escapes with htmlspecialchars(). If you wish to use the data on a landing page you must decode it with htmlspecialchars_decode() followed by rawurldecode() in that order. But really, if you are using any characters that need to be encoded in the first place you should probably just stop.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$url</td> <td>Unescaped input URL.</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>Encoded and escaped URL.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isAlnum"> <div class="location">in <a href="../../../Tfish/Traits/ValidateString.html#method_isAlnum"><abbr title="Tfish\Traits\ValidateString">ValidateString</abbr></a> at line 59</div> <code> bool <strong>isAlnum</strong>(string $alnum) </code> </h3> <div class="details"> <div class="method-description"> <p>Check that a string is comprised solely of alphanumeric characters.</p> <p>Accented regional characters are rejected. This method is designed to be used to check database identifiers or object property names.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$alnum</td> <td>Input to be tested.</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td>True if valid alphanumerical string, false otherwise.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isAlnumUnderscore"> <div class="location">in <a href="../../../Tfish/Traits/ValidateString.html#method_isAlnumUnderscore"><abbr title="Tfish\Traits\ValidateString">ValidateString</abbr></a> at line 77</div> <code> bool <strong>isAlnumUnderscore</strong>(string $alnumUnderscore) </code> </h3> <div class="details"> <div class="method-description"> <p>Check that a string is comprised solely of alphanumeric characters and underscores.</p> <p>Accented regional characters are rejected. This method is designed to be used to check database identifiers or object property names.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$alnumUnderscore</td> <td>Input to be tested.</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td>True if valid alphanumerical or underscore string, false otherwise.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isAlpha"> <div class="location">in <a href="../../../Tfish/Traits/ValidateString.html#method_isAlpha"><abbr title="Tfish\Traits\ValidateString">ValidateString</abbr></a> at line 95</div> <code> bool <strong>isAlpha</strong>(string $alpha) </code> </h3> <div class="details"> <div class="method-description"> <p>Check that a string is comprised solely of alphabetical characters.</p> <p>Tolerates vanilla ASCII only. Accented regional characters are rejected. This method is designed to be used to check database identifiers or object property names.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$alpha</td> <td>Input to be tested.</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td>True if valid alphabetical string, false otherwise.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_isUtf8"> <div class="location">in <a href="../../../Tfish/Traits/ValidateString.html#method_isUtf8"><abbr title="Tfish\Traits\ValidateString">ValidateString</abbr></a> at line 113</div> <code> bool <strong>isUtf8</strong>(string $text) </code> </h3> <div class="details"> <div class="method-description"> <p>Check if the character encoding of text is UTF-8.</p> <p>All strings received from external sources must be passed through this function, particularly prior to storage in the database.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$text</td> <td>Input string to check.</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>bool</td> <td>True if string is UTF-8 encoded otherwise false.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_trimString"> <div class="location">in <a href="../../../Tfish/Traits/ValidateString.html#method_trimString"><abbr title="Tfish\Traits\ValidateString">ValidateString</abbr></a> at line 131</div> <code> string <strong>trimString</strong>(mixed $text) </code> </h3> <div class="details"> <div class="method-description"> <p>Cast to string, check UTF-8 encoding and strip trailing whitespace and control characters.</p> <p>Removes trailing whitespace and control characters (ASCII <= 32 / UTF-8 points 0-32 inclusive), checks for UTF-8 character set and casts input to a string. Note that the data returned by this function still requires escaping at the point of use; it is not database or XSS safe.</p> <p>As the input is cast to a string do NOT apply this function to non-string types (int, float, bool, object, resource, null, array, etc).</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>mixed</td> <td>$text</td> <td>Input to be trimmed.</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>Trimmed and UTF-8 validated string.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method___get"> <div class="location">at line 99</div> <code> <strong>__get</strong>($property) </code> </h3> <div class="details"> <div class="method-description"> <p>Magic get access is to support the Tree class - better to refactor it.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td></td> <td>$property</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_load"> <div class="location">at line 113</div> <code> <strong>load</strong>(array $row, bool $convertUrlToConstant = true) </code> </h3> <div class="details"> <div class="method-description"> <p>Load properties.</p> <p>Parameters are validated by the respective setters.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>array</td> <td>$row</td> <td>Data to load into properties.</td> </tr> <tr> <td>bool</td> <td>$convertUrlToConstant</td> <td>Convert the TFISH_LINK constant to a URL and vice-versa to aid portability.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_bytesToHumanReadable"> <div class="location">at line 161</div> <code> string <strong>bytesToHumanReadable</strong>(int $bytes) </code> </h3> <div class="details"> <div class="method-description"> <p>Converts bytes to a human readable units (KB, MB, GB etc).</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$bytes</td> <td>File size in bytes.</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>Bytes expressed as convenient human readable units.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_convertBaseUrlToConstant"> <div class="location">at line 194</div> <code> protected <strong>convertBaseUrlToConstant</strong>(string $html, bool $convertToConstant = false) </code> </h3> <div class="details"> <div class="method-description"> <p>Convert the site base URL to the TFISH_LINK constant and vice versa.</p> <p>This aids site portability. The URL is stored as a constant in the database, but is converted to actual URL on display. If the domain changes at some point all the references to TFISH_LINK will update automatically.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$html</td> <td>HTML field to search and replace.</td> </tr> <tr> <td>bool</td> <td>$convertToConstant</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_url"> <div class="location">at line 228</div> <code> string <strong>url</strong>(string $customRoute = '') </code> </h3> <div class="details"> <div class="method-description"> <p>Return a URL (permalink) to a content object.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$customRoute</td> <td>Override to customise the URL.</td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$url.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_id"> <div class="location">at line 264</div> <code> int <strong>id</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return ID.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>int</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setId"> <div class="location">at line 274</div> <code> <strong>setId</strong>(int $id) </code> </h3> <div class="details"> <div class="method-description"> <p>Set ID</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$id</td> <td>ID of content object.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_title"> <div class="location">at line 288</div> <code> string <strong>title</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return title.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setTitle"> <div class="location">at line 298</div> <code> <strong>setTitle</strong>(string $title) </code> </h3> <div class="details"> <div class="method-description"> <p>Set title</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$title</td> <td>Title of content object.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_type"> <div class="location">at line 308</div> <code> string <strong>type</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return type of content object.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setType"> <div class="location">at line 318</div> <code> <strong>setType</strong>(string $type) </code> </h3> <div class="details"> <div class="method-description"> <p>Set type.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$type</td> <td>Type of content object.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_teaser"> <div class="location">at line 336</div> <code> string <strong>teaser</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return teaser.</p> <p>This is a HTML field. It has been input-validated but should not be output escaped.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_teaserForDisplay"> <div class="location">at line 348</div> <code> string <strong>teaserForDisplay</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return teaser with TFISH_LINK constant converted to URL.</p> <p>This is a HTML field. It has been input-validated but should not be output escaped.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setTeaser"> <div class="location">at line 359</div> <code> <strong>setTeaser</strong>(string $teaser) </code> </h3> <div class="details"> <div class="method-description"> <p>Set teaser.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$teaser</td> <td>HTML teaser.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_description"> <div class="location">at line 371</div> <code> string <strong>description</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return description.</p> <p>This is a HTML field. It has been input-validated but should not be output escaped.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_descriptionForDisplay"> <div class="location">at line 383</div> <code> string <strong>descriptionForDisplay</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return description with TFISH_LINK constant converted to URL.</p> <p>This is a HTML field. It has been input-validated but should not be output escaped.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setDescription"> <div class="location">at line 394</div> <code> <strong>setDescription</strong>(string $description) </code> </h3> <div class="details"> <div class="method-description"> <p>Set description.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$description</td> <td>HTML description.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_creator"> <div class="location">at line 404</div> <code> string <strong>creator</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return creator.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setCreator"> <div class="location">at line 414</div> <code> <strong>setCreator</strong>(string $creator) </code> </h3> <div class="details"> <div class="method-description"> <p>Set creator.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$creator</td> <td>Author of this content.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_media"> <div class="location">at line 424</div> <code> string <strong>media</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return media file name.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setMedia"> <div class="location">at line 434</div> <code> <strong>setMedia</strong>(string $filename) </code> </h3> <div class="details"> <div class="method-description"> <p>Set media file name.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$filename</td> <td>Media file name.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_extension"> <div class="location">at line 460</div> <code> string <strong>extension</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return file extension.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_format"> <div class="location">at line 470</div> <code> string <strong>format</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return format (mimetype).</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setFormat"> <div class="location">at line 480</div> <code> <strong>setFormat</strong>(string $format) </code> </h3> <div class="details"> <div class="method-description"> <p>Set format.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$format</td> <td>Mimetype of media attachment.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_fileSize"> <div class="location">at line 497</div> <code> string <strong>fileSize</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return file size of media attachment.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setFileSize"> <div class="location">at line 507</div> <code> <strong>setFileSize</strong>(int $fileSize) </code> </h3> <div class="details"> <div class="method-description"> <p>Set file size of media attachment.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$fileSize</td> <td>File size in bytes.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_image"> <div class="location">at line 521</div> <code> string <strong>image</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return image name.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setImage"> <div class="location">at line 531</div> <code> <strong>setImage</strong>(string $filename) </code> </h3> <div class="details"> <div class="method-description"> <p>Set image.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$filename</td> <td>Name of image file.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_caption"> <div class="location">at line 556</div> <code> string <strong>caption</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return caption of image.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setCaption"> <div class="location">at line 566</div> <code> <strong>setCaption</strong>(string $caption) </code> </h3> <div class="details"> <div class="method-description"> <p>Set caption.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$caption</td> <td>Caption to image file.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_date"> <div class="location">at line 576</div> <code> <a target="_blank" href="http://php.net/DateTime">DateTime</a> <strong>date</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return date as a DateTime object that can be manipulated.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a target="_blank" href="http://php.net/DateTime">DateTime</a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setDate"> <div class="location">at line 586</div> <code> <strong>setDate</strong>(string $date) </code> </h3> <div class="details"> <div class="method-description"> <p>Set date.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$date</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_info"> <div class="location">at line 604</div> <code> string <strong>info</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return meta information about content object.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_submissionTime"> <div class="location">at line 630</div> <code> int <strong>submissionTime</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return submission time.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>Timestamp.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setSubmissionTime"> <div class="location">at line 640</div> <code> <strong>setSubmissionTime</strong>(int $timestamp) </code> </h3> <div class="details"> <div class="method-description"> <p>Set submission time.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$timestamp</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_lastUpdated"> <div class="location">at line 654</div> <code> int <strong>lastUpdated</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return last modification time.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$timestamp</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setLastUpdated"> <div class="location">at line 664</div> <code> <strong>setLastUpdated</strong>(int $timestamp) </code> </h3> <div class="details"> <div class="method-description"> <p>Set last updated time.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$timestamp</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_expiresOn"> <div class="location">at line 680</div> <code> int <strong>expiresOn</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return expiry date.</p> <p>Expiry date is not yet implemented.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$timestamp</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setExpiresOn"> <div class="location">at line 690</div> <code> <strong>setExpiresOn</strong>(int $timestamp) </code> </h3> <div class="details"> <div class="method-description"> <p>Set expiry time.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$timestamp</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_counter"> <div class="location">at line 706</div> <code> int <strong>counter</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return view/download counter.</p> <p>The counter tracks downloads for download content types, and views for everything else.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>int</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setCounter"> <div class="location">at line 716</div> <code> <strong>setCounter</strong>(int $counter) </code> </h3> <div class="details"> <div class="method-description"> <p>Set view/download counter.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$counter</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_onlineStatus"> <div class="location">at line 730</div> <code> int <strong>onlineStatus</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return online status.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>0 if offline, 1 if online.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setOnlineStatus"> <div class="location">at line 740</div> <code> <strong>setOnlineStatus</strong>(int $status) </code> </h3> <div class="details"> <div class="method-description"> <p>Set online status.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$status</td> <td>0 for offline, 1 for online.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_parent"> <div class="location">at line 754</div> <code> int <strong>parent</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return parent ID.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>ID of parent collection object.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setParent"> <div class="location">at line 764</div> <code> <strong>setParent</strong>(int $parent) </code> </h3> <div class="details"> <div class="method-description"> <p>Set parent.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$parent</td> <td>ID of parent collection.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_language"> <div class="location">at line 782</div> <code> string <strong>language</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return language.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>Two-letter ISO language code.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setLanguage"> <div class="location">at line 792</div> <code> <strong>setLanguage</strong>(string $language) </code> </h3> <div class="details"> <div class="method-description"> <p>Set language.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$language</td> <td>Two-letter ISO language code.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_rights"> <div class="location">at line 808</div> <code> int <strong>rights</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return rights.</p> <p>Rights is an index to a license found in listRights();</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>int</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setRights"> <div class="location">at line 820</div> <code> <strong>setRights</strong>(int $rights) </code> </h3> <div class="details"> <div class="method-description"> <p>Set rights.</p> <p>Index to license stored in listRights().</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>int</td> <td>$rights</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_publisher"> <div class="location">at line 834</div> <code> string <strong>publisher</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return publisher.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setPublisher"> <div class="location">at line 844</div> <code> <strong>setPublisher</strong>(string $publisher) </code> </h3> <div class="details"> <div class="method-description"> <p>Set publisher.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$publisher</td> <td>The publisher of this content.</td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_module"> <div class="location">at line 856</div> <code> string <strong>module</strong>() </code> </h3> <div class="details"> <div class="method-description"> <p>Return module.</p> <p>Deprecated.</p> </div> <div class="tags"> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_setModule"> <div class="location">at line 868</div> <code> <strong>setModule</strong>(string $module) </code> </h3> <div class="details"> <div class="method-description"> <p>Set module.</p> <p>Deprecated, will be removed.</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$module</td> <td>Name of module.</td> </tr> </table> </div> </div> </div> </div> </div> <div id="footer"> Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>. </div> </div> </div> </body> </html>