SwatObject
└─SwatDBDataObject
└─SiteArticle
public class SiteArticle
extends SwatDBDataObject
| Field Summary | |
|---|---|
| final mixed | The maximum depth of articles in the article tree. |
| string | User visible content. |
| Date | Create date. |
| string | User visible description. |
| integer | Order of display. |
| boolean | Whether article can be loaded on the front-end (customer visible). |
| integer | Unique identifier. |
| Date | Modified date. |
| protected array | |
| boolean | Weather article is included in search results. |
| string | Short, textual identifer for this article. |
| string | User visible title. |
| boolean | Whether article is listed in sub-article lists. |
| Fields inherited from SwatDB.SwatDBDataObject | |
|---|---|
| class_map, db, id_field, read_only, table | |
| Method Summary | |
|---|---|
| array | Gets the set of SwatNavBarEntry objects for this article. |
| SiteArticleWrapper | Get the sub-articles of this article that are both shown and enabled. |
| protected void | init() |
| boolean | loadByShortname(string shortname) Loads an article from its shortname. |
| protected void | loadPath() Loads the URL fragment of this article. |
| protected SiteArticleWrapper | Loads the sub-articles of this article. |
| boolean | loadWithPath(string path, array fields) Loads an article from the database with a path. |
public final mixed MAX_DEPTH = 8
The maximum depth of articles in the article tree
Objects that interact with articles may choose not to respect articles with a depth greater than this value.
The root article is the zero-th level article.
public string $bodytext
User visible content
public Date $createdate
Create date
public string $description
User visible description
public integer $displayorder
Order of display
public boolean $enabled
Whether article can be loaded on the front-end (customer visible)
public integer $id
Unique identifier
public Date $modified_date
Modified date
protected array $navbar_entries
public boolean $searchable
Weather article is included in search results
public string $shortname
Short, textual identifer for this article
The shortname must be unique among siblings and is intended for use in URL's.
public string $title
User visible title
public boolean $visible
Whether article is listed in sub-article lists
public array getNavBarEntries()
Gets the set of SwatNavBarEntry objects for this article
public SiteArticleWrapper getVisibleSubArticles()
Get the sub-articles of this article that are both shown and enabled
protected void init()
public boolean loadByShortname(string shortname)
Loads an article from its shortname
shortname - the shortname of the article to load.protected void loadPath()
Loads the URL fragment of this article
If the path was part of the initial query to load this article, that value is returned. Otherwise, a separate query gets the path of this article. If you are calling this method frequently during a single request, it is more efficient to include the path in the initial article query.
protected SiteArticleWrapper loadSubArticles()
Loads the sub-articles of this article
public boolean loadWithPath(string path, array fields)
Loads an article from the database with a path
path - the path of the article in the article tree. Article nodes are separated by a '/' character.fields - the article fields to load from the database. By default, only the id and title are loaded. The path pseudo-field is always populated from the $path parameter.
An article in an web application
Articles in a web application represent generic navigatable pages that contain content.
SiteArticle objects themselves may represent a tree structure by accessing the
SiteArticle::$parentproperty.