Article

Represents a static article.

Inherits

LnBlogObject, Entry, BlogEntry

Events

OnInitFired when the object is created.
InitCompleteFired at end of constructor.
OnInsertFired before object is saved to persistent storage.
InsertCompleteFired after object has finished saving.
OnOutputFired before output is generated.
OutputCompleteFired after output has finished being generated.
Summary
ArticleRepresents a static article.
Functions
isArticleDetermine if this object is, in fact, an article.
settickySet whether or not an article should be considered “featured”.
isStickyDetermines if the article is set as sticky.
readStickyGet the title and permalink without retreiving the entire article.
entryIDGets the ID of the article, which is normally just the last portion of the path.
getPathBuilds a path to store the given article.
insertSave the object as a new article.

Functions

isArticle

public function isArticle($path = false)

Determine if this object is, in fact, an article.  This is based on the internal storage format of the article information, i.e. if the correct storage format is found, then it’s an article.

Parameters

pathOptional parameter for the unique ID of the object.  This should only be used by back-end classes.

Returns

True if object is a valid article, false otherwise.

setticky

Set whether or not an article should be considered “featured”.  Articles not set sticky should be considered archival and not shown on things like front-page article lists.

Parameters

showOptional boolean parameter to turn stickiness on or off.  Default is true (stickiness on).

Returns

True on success, false on failure.

isSticky

public function isSticky($path = false)

Determines if the article is set as sticky.

Parameters

pathOptional unique ID for the article.

Returns

True if the article is sticky, false otherwise.

readSticky

public function readSticky($path)

Get the title and permalink without retreiving the entire article.

Parameters

pathThe unique ID for the article.

Returns

A two-element array, with “link” and “title” for the permalink and subject of the article.

entryID

public function entryID()

Gets the ID of the article, which is normally just the last portion of the path.

Returns

A string containing the unique ID of this article.

getPath

public function getPath($curr_ts = false,
$just_name = false,
$long_format = false)

Builds a path to store the given article.  This is only meaningful for file-based storage and should only be used internally.

Parameters

curr_tsAn optional timestamp.
just_nameOptional boolean to return just a file name.
long_formatOptional boolean to use long date format.

Returns

A string to use for the path to the article.

insert

public function insert ($blog,  
$from_draft = false)

Save the object as a new article.

Parameters

blogThe blog object into which the article should be inserted.
from_draftIndicates that the article is based on a draft entry, not taken directly from user input.

Returns

True on success, false on failure.

public function isArticle($path = false)
Determine if this object is, in fact, an article.
public function isSticky($path = false)
Determines if the article is set as sticky.
public function readSticky($path)
Get the title and permalink without retreiving the entire article.
public function entryID()
Gets the ID of the article, which is normally just the last portion of the path.
public function getPath($curr_ts = false,
$just_name = false,
$long_format = false)
Builds a path to store the given article.
public function insert ($blog,  
$from_draft = false)
Save the object as a new article.
A base object which is event-aware, i.e.
An abstract class representing entries of all types in the blog database.
Represents an entry in the weblog.
Close