\DocumentationEntity
A {@link DocumentationEntity} represents a module or folder with stored documentation files. An entity not an individual page but a `section` of documentation arranged by version and language.
Each entity has a version assigned to it (i.e master) and folders can be
labeled with a specific version. For instance, doc.silverstripe.org has three
DocumentEntities for Framework - versions 2.4, 3.0 and 3.1. In addition an
entity can have a language attached to it. So for an instance with en, de and
fr documentation you may have three registered.
Synopsis
class DocumentationEntity
extends ViewableData
{
- // members
- protected $key;
- protected $title;
- protected $versionTitle;
- protected $defaultEntity;
- protected bool $archived = false;
- protected $path;
- protected $version;
- protected $branch;
- protected $stable;
- protected $language;
- // methods
- public void __construct()
- public string getTitle()
- public $this setTitle()
- public string Link()
- public string __toString()
- public boolean hasRecord()
- public $this setIsDefaultEntity()
- public boolean getIsDefaultEntity()
- public string getKey()
- public string getLanguage()
- public $this setLanguage()
- public $this setVersion()
- public float getVersion()
- public string getVersionTitle()
- public $this setVersionTitle()
- public $this setIsArchived()
- public bool getIsArchived()
- public $this setBranch()
- public float getBranch()
- public string getPath()
- public $this setPath()
- public $this setIsStable()
- public boolean getIsStable()
- public int compare()
- public array toMap()
Hierarchy
Extends
- ViewableData
Members
protected
- $archived
—
bool
Set if this version is archived - $branch
—
string
The repository branch name (allows for $version to be an alias on development branches). - $defaultEntity
—
boolean
If the system is setup to only document one entity then you may only want to show a single entity in the URL and the sidebar. Set this when you register the entity with the key `DefaultEntity` and the URL will not include any version or language information. - $key
—
string
The key to match entities with that is not localized. For instance, you may have three entities (en, de, fr) that you want to display a nice title for, but matching needs to occur on a specific key. - $language — string
- $path — mixed
- $stable
—
boolean
If this entity is a stable release or not. If it is not stable (i.e it could be a past or future release) then a warning message will be shown. - $title
—
string
The human readable title of this entity. Set when the module is registered. - $version — float
- $versionTitle
—
string
Label for this version
Methods
public
- __construct()
- Link() — Returns the web accessible link to this entity.
- __toString()
- compare() — Returns an integer value based on if a given version is the latest version. Will return -1 for if the version is older, 0 if versions are the same and 1 if the version is greater than.
- getBranch()
- getIsArchived()
- getIsDefaultEntity()
- getIsStable()
- getKey()
- getLanguage()
- getPath()
- getTitle() — Get the title of this module.
- getVersion()
- getVersionTitle() — Get the version for this title
- hasRecord()
- setBranch()
- setIsArchived() — Set if this is archived
- setIsDefaultEntity()
- setIsStable()
- setLanguage()
- setPath()
- setTitle()
- setVersion()
- setVersionTitle() — Sets the title for this version
- toMap()