Tuskfish API V1.1.3
  • Package
  • Class

Packages

  • content
  • core
  • database
  • installation
  • security
  • user
  • utilities

Classes

  • TfCache
  • TfDataObject
  • TfFileHandler
  • TfLogger
  • TfMetadata
  • TfPaginationControl
  • TfPreference
  • TfPreferenceHandler
  • TfTemplate
  • TfTree

Traits

  • TfLanguage
  • TfMagicMethods
  • TfMimetypes
  • TfRights

Functions

  • checkPasswordStrength
  • hashPassword
  • tf_autoload
  • tfContentModuleAutoload

Class TfDataObject

Base class for data objects providing properties and methods that are standard in Tuskfish.

I thought about making this a trait, since it will apply across otherwise unrelated families of content objects, but I'm still lukewarm on using traits for anything other than static lists.

Direct known subclasses

TfContentObject

Indirect known subclasses

TfArticle, TfAudio, TfBlock, TfCollection, TfDownload, TfImage, TfStatic, TfTag, TfVideo

Package: core
Copyright: Simon Wilkinson 2013+ (https://tuskfish.biz)
License: GNU General Public License (GPL) V2
Author: Simon Wilkinson simon@isengard.biz
Version: Release: 1.0
Since: 1.1.2
Properties: int $id Auto-increment, set by database.
Properties: int $online Toggle object on or offline.
Properties: int $submissionTime Timestamp representing submission time.
Properties: int $lastUpdated Timestamp representing last time this object was updated.
Properties: int $expiresOn Timestamp indicating the expiry date for this object.
Properties: int $counter Number of times this content was viewed or downloaded.
Properties: string $metaTitle Set a custom page title for this content.
Properties: string $metaDescription Set a custom page meta description for this content.
Properties: string $seo SEO-friendly string; it will be appended to the URL for this content.
Properties: string $handler Handler for this object (not persistent).
Properties: string $template The template that should be used to display this object (not persistent).
Properties: string $module The module that handles this content type (not persistent).
Properties: string $icon The vector icon that represents this object type (not persistent).
Located at trust_path/libraries/tuskfish/class/TfDataObject.php

Methods summary

protected string
# convertBaseUrlToConstant( string $html, boolean $convertToConstant = false )

Convert URLs back to TFISH_LINK and back for insertion or update, to aid portability.

Convert URLs back to TFISH_LINK and back for insertion or update, to aid portability.

This is a helper method for loadPropertiesFromArray(). Only useful on HTML fields. Basically it converts the base URL of your site to the TFISH_LINK constant for storage or vice versa for display. If you change the base URL of your site (eg. domain) all your internal links will automatically update when they are displayed.

Parameters

$html
A HTML field that makes use of the TFISH_LINK constant.
$convertToConstant
$liveUrls Flag to convert urls to constants (true) or constants to urls (false).

Returns

string
HTML field with converted URLs.
public string
# getUrl( string $customPage = '' )

Generates a URL to access this object in single view mode.

Generates a URL to access this object in single view mode.

URL can point relative to either the home page (index.php, or other custom content stream page defined by modifying TFISH_PERMALINK_URL in config.php) or to an arbitrary page in the web root. For example, you could rename index.php to 'blog.php' to free up the index page for a landing page (this requires you to append the name of the new page to the TFISH_PERMALINK_URL constant).

Parameters

$customPage
Use an arbitrary target page or the home page (index.php).

Returns

string
URL to view this object.
public
# updateLastUpdated( )

Reset the last updated time for this content object (timestamp).

Reset the last updated time for this content object (timestamp).

public
# setId( integer $id )

Set the ID for this object.

Set the ID for this object.

Parameters

$id
ID of this object.
public integer
# getId( )

Returns the ID of the content object, XSS safe.

Returns the ID of the content object, XSS safe.

Returns

integer
ID of content object.
public
# setSubmissionTime( integer $submissionTime )

Set the submission time for this expert.

Set the submission time for this expert.

Parameters

$submissionTime
Timestamp.
public string
# getSubmissionTime( )

Return formatted date that this expert was submitted.

Return formatted date that this expert was submitted.

Returns

string
Date/time of submission.
public
# setLastUpdated( integer $lastUpdated )

Set the time this expert was last updated.

Set the time this expert was last updated.

Parameters

$lastUpdated
Timestamp.
public string
# getLastUpdated( )

Return formatted date/time this expert was last updated, escaped for display.

Return formatted date/time this expert was last updated, escaped for display.

Returns

string
Date/time last updated.
public
# setExpiresOn( integer $expiresOn )

Set the time this expert profile expires.

Set the time this expert profile expires.

Parameters

$expiresOn
Timestamp.
public
# setOnline( integer $online )

Set this profile as online or offline.

Set this profile as online or offline.

Offline profiles are not publicly accessible and are not returned in search results.

Parameters

$online
Online (1) or offline (0).
public boolean
# getOnline( )

Returns the XSS-safe online status of this record.

Returns the XSS-safe online status of this record.

Returns

boolean
True if online, false otherwise.
public
# setCounter( integer $counter )

Set the view counter for this profile.

Set the view counter for this profile.

Parameters

$counter
Number of times this profile has been viewed.
public integer
# getCounter( )

Returns the number of times this expert was viewed, XSS safe.

Returns the number of times this expert was viewed, XSS safe.

Returns

integer
View counter.
public
# setMetaTitle( string $metaTitle )

Set the meta title for this expert.

Set the meta title for this expert.

Parameters

$metaTitle
Meta title.
public string
# getMetaTitle( )

Returns the meta title for this expert XSS escaped for display.

Returns the meta title for this expert XSS escaped for display.

Returns

string
Meta title.
public
# setMetaDescription( string $metaDescription )

Set the meta description for this expert.

Set the meta description for this expert.

Parameters

$metaDescription
Meta description.
public string
# getMetaDescription( )

Return the meta description of this expert XSS escaped for display.

Return the meta description of this expert XSS escaped for display.

Returns

string
Meta description.
public
# setSeo( string $seo )

Set the SEO-friendly search string for this content object.

Set the SEO-friendly search string for this content object.

The SEO string will be appended to the URL for this object.

Parameters

$seo
Dash-separated-title-of-this-object.
public string
# getSeo( )

Return the SEO string for this expert XSS for display.

Return the SEO string for this expert XSS for display.

Returns

string
SEO-friendly URL string.
public
# setHandler( string $handler )

Set the handler class for this sensor type.

Set the handler class for this sensor type.

Parameters

$handler
Handler name (alphabetical characters only).f
public
# setModule( string $module )

Set the module for this sensor.

Set the module for this sensor.

Usually handled by the sensor's constructor.

Parameters

$module
Module name (alphabetical characters only).
public
# setTemplate( string $template )

Set the template file for displaying this sensor.

Set the template file for displaying this sensor.

The equivalent HTML template file must be present in the active theme.

Parameters

$template
Template filename without extension, eg. 'camera'.
public
# setIcon( string $icon )

Set (override) the icon for this expert.

Set (override) the icon for this expert.

Parameters

$icon
Icon expressed as a FontAwesome tag, eg. ''
public string
# getIcon( )

Returns the Font Awesome icon for this expert, XSS safe (prevalidated with HTMLPurifier).

Returns the Font Awesome icon for this expert, XSS safe (prevalidated with HTMLPurifier).

Returns

string
FontAwesome icon for this expert (HTML).

Properties summary

protected string $id

Common properties.

Common properties.

# ''
protected string $submissionTime
# ''
protected string $lastUpdated
# ''
protected string $expiresOn
# ''
protected string $counter
# ''
protected string $online
# ''
protected string $metaTitle
# ''
protected string $metaDescription
# ''
protected string $seo
# ''
protected string $handler
# ''
protected string $template
# ''
protected string $module
# ''
protected string $icon
# ''
Tuskfish API V1.1.3 API documentation generated by ApiGen