silverorange Code


Site.SiteArticle
/Site/dataobjects/SiteArticle.php at line 19

Class SiteArticle

SwatObject
└─SwatDBDataObject
└─SiteArticle

public class SiteArticle
extends SwatDBDataObject

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::$parent property.

Copyright:
2006-2007 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Field Summary
final mixed

MAX_DEPTH

The maximum depth of articles in the article tree.

string

$bodytext

User visible content.

Date

$createdate

Create date.

string

$description

User visible description.

integer

$displayorder

Order of display.

boolean

$enabled

Whether article can be loaded on the front-end (customer visible).

integer

$id

Unique identifier.

Date

$modified_date

Modified date.

protected array

$navbar_entries

boolean

$searchable

Weather article is included in search results.

string

$shortname

Short, textual identifer for this article.

string

$title

User visible title.

boolean

$visible

Whether article is listed in sub-article lists.

Fields inherited from SwatDB.SwatDBDataObject
class_map, db, id_field, read_only, table
Method Summary
array

getNavBarEntries()

Gets the set of SwatNavBarEntry objects for this article.

SiteArticleWrapper

getVisibleSubArticles()

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

loadSubArticles()

Loads the sub-articles of this article.

boolean

loadWithPath(string path, array fields)

Loads an article from the database with a path.

Methods inherited from SwatDB.SwatDBDataObject
checkDB, delete, deleteInternal, duplicate, generatePropertyHashes, getId, getInternalValue, getLoaderMethod, getModifiedProperties, getProperties, getPublicProperties, getSerializablePrivateProperties, getSerializableSubDataObjects, getSubDataObject, getUsingInternalProperty, getUsingLoaderMethod, guessType, hasInternalValue, hasSubDataObject, init, initFromRow, isModified, load, loadInternal, registerDateProperty, registerInternalProperty, save, saveInternal, saveInternalProperties, saveNewBinding, saveSubDataObjects, serialize, setDatabase, setInternalValue, setSubDataObject, setTable, unserialize, unsetSubDataObject, wakeup

Field Detail

/Site/dataobjects/SiteArticle.php at line 31

MAX_DEPTH

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.


/Site/dataobjects/SiteArticle.php at line 62

bodytext

public string $bodytext

User visible content


/Site/dataobjects/SiteArticle.php at line 69

createdate

public Date $createdate

Create date


/Site/dataobjects/SiteArticle.php at line 55

description

public string $description

User visible description


/Site/dataobjects/SiteArticle.php at line 83

displayorder

public integer $displayorder

Order of display


/Site/dataobjects/SiteArticle.php at line 90

enabled

public boolean $enabled

Whether article can be loaded on the front-end (customer visible)


/Site/dataobjects/SiteArticle.php at line 41

id

public integer $id

Unique identifier


/Site/dataobjects/SiteArticle.php at line 76

modified_date

public Date $modified_date

Modified date


/Site/dataobjects/SiteArticle.php at line 124
protected array $navbar_entries

See Also:
SiteArticle::getNavBarEntries()

/Site/dataobjects/SiteArticle.php at line 104

searchable

public boolean $searchable

Weather article is included in search results


/Site/dataobjects/SiteArticle.php at line 114

shortname

public string $shortname

Short, textual identifer for this article

The shortname must be unique among siblings and is intended for use in URL's.


/Site/dataobjects/SiteArticle.php at line 48

title

public string $title

User visible title


/Site/dataobjects/SiteArticle.php at line 97

visible

public boolean $visible

Whether article is listed in sub-article lists


Method Detail

/Site/dataobjects/SiteArticle.php at line 134

getNavBarEntries

public array getNavBarEntries()

Gets the set of SwatNavBarEntry objects for this article

Returns:
the set of SwatNavBarEntry objects for this article.

/Site/dataobjects/SiteArticle.php at line 171

getVisibleSubArticles

public SiteArticleWrapper getVisibleSubArticles()

Get the sub-articles of this article that are both shown and enabled

Returns:
a recordset of sub-articles of the specified article.

/Site/dataobjects/SiteArticle.php at line 278

init

protected void init()

/Site/dataobjects/SiteArticle.php at line 251

loadByShortname

public boolean loadByShortname(string shortname)

Loads an article from its shortname

Parameters:
shortname - the shortname of the article to load.
Returns:
true if the loading of this article was successfil and false if the article with the given shortname doesn't exist.

/Site/dataobjects/SiteArticle.php at line 304

loadPath

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.


/Site/dataobjects/SiteArticle.php at line 330

loadSubArticles

protected SiteArticleWrapper loadSubArticles()

Loads the sub-articles of this article

Returns:
a recordset of sub-articles of the specified article.

/Site/dataobjects/SiteArticle.php at line 206

loadWithPath

public boolean loadWithPath(string path, array fields)

Loads an article from the database with a path

Parameters:
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.
Returns:
true if an article was successfully loaded and false if no article was found at the specified path.

silverorange Code