Detailed Description

InternalLink contains static methods for handling internal application links.

These links are useful in a scenario, where an object represents a page and several subobjects represent page elements.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 22 of file InternalLink.php.

Static Public Member Functions

static makeLink (ObjectId $oid)
 
static makeAnchorLink (ObjectId $oid, ObjectId $anchorOID, $anchorName=null)
 
static isLink ($link)
 
static getReferencedOID ($link)
 
static getAnchorOID ($link)
 
static getAnchorName ($link)
 

Public Attributes

const PROTOCOL_STR = "link://"
 

Member Function Documentation

◆ makeLink()

static makeLink ( ObjectId  $oid)
static

Make an internal link to an object.

Parameters
$oidThe id of the object to link to
Returns
The link

Definition at line 31 of file InternalLink.php.

◆ makeAnchorLink()

static makeAnchorLink ( ObjectId  $oid,
ObjectId  $anchorOID,
  $anchorName = null 
)
static

Make an internal link to an object.

Parameters
$oidThe object id of the object to link to
$anchorOIDThe object id of the subobject to link to
$anchorNameThe name inside the subobject to link to (null, if the object itself should be linked) (default: null)
Returns
The link

Definition at line 42 of file InternalLink.php.

◆ isLink()

static isLink (   $link)
static

Test if a link is an internal link.

Parameters
$linkThe link to test
Returns
Boolean whether the link is an internal link or not

Definition at line 55 of file InternalLink.php.

◆ getReferencedOID()

static getReferencedOID (   $link)
static

Get the oid of the referenced object.

Parameters
$linkThe link to process
Returns
The oid or null if no valid oid is referenced

Definition at line 64 of file InternalLink.php.

◆ getAnchorOID()

static getAnchorOID (   $link)
static

Get the oid of the referenced subobject if any.

Parameters
$linkThe link to process
Returns
The oid or null if no anchor is defined

Definition at line 78 of file InternalLink.php.

◆ getAnchorName()

static getAnchorName (   $link)
static

Get the name of the anchor inside the referenced subobject if any.

Parameters
$linkThe link to process
Returns
The name or null if no anchor name is defined

Definition at line 92 of file InternalLink.php.

Member Data Documentation

◆ PROTOCOL_STR

const PROTOCOL_STR = "link://"

Definition at line 24 of file InternalLink.php.