Creates a new content type.
array('name' => 'dateEaten', 'typeId' => SGL_CONTENT_ATTR_TYPE_DATE)))
array('name' => 'dishName', 'typeId' => SGL_CONTENT_ATTR_TYPE_TEXT)))
array('name' => 'overallRating', 'typeId' => SGL_CONTENT_ATTR_TYPE_FLOAT)))
Parameters:
API Tags:
static SGL_Content getById(
integer
$id, [
$langCode = null], [
$version = null]
)
|
|
Returns a populated content object by id at current version
Parameters:
|
integer |
$id: |
|
|
|
$langCode: |
|
|
|
$version: |
|
API Tags:
Returns a content object matching supplied name at current version.
Parameters:
API Tags:
Information Tags:
| Todo: | ensure uniqueness of name property |
Returns a content object structure with no data, according to type name or ID passed.
Parameters:
|
mixed |
$type: |
An integer or string referencing a content type |
API Tags:
SGL_Content __construct(
[object
$oData = null], [
$loadAttribs = true]
)
|
|
Consructor.
Populates the object if $oData is supplied. Here's an example using data from a web form:
Parameters:
|
object |
$oData: |
|
|
|
$loadAttribs: |
|
Adds an attribute object to a SGL_Content object instance.
array('name' => 'dateEaten', 'typeId' => SGL_CONTENT_ATTR_TYPE_DATE))
);
Parameters:
API Tags:
void delete(
[boolean
$safe = true]
)
|
|
Deletes an instance of content.
Parameters:
API Tags:
Ensures all attributes of a content item are loaded when editing the content item.
This is useful when a content type has been modified and extra attributes have been added.
API Tags:
Information Tags:
| Todo: | remove, never called |
| Todo: | contains hard-coded content type ID |
integer getAttribId(
string
$attribName
)
|
|
Returns ID for a given attrib name.
Parameters:
API Tags:
array getLinkedContents(
[integer
$typeId = null]
)
|
|
Returns an array of content objects associated with current content object.
Alternatively associated contents can be constrained by type.
// get all associated comments
Parameters:
API Tags:
Returns the status of a content object.
API Tags:
Returns an integer representing the type id of the content object.
if ($type != SGL_CMS_CONTENTTYPE_RESTAURANT_REVIEW) { // do something ...}
API Tags:
boolean rename(
string
$newName
)
|
|
Renames a SGL_Content item.
Parameters:
API Tags:
SGL_Content save(
[
$newVersion = false], [
$newLang = false]
)
|
|
Saves a content object and returns the object with PK.
Parameters:
API Tags:
| See: | SGL_Content::createType(); |
| Access: | public |
void setStatus(
integer
$status
)
|
|
Sets the status of a content object.
$oRestoReview->setStatus(SGL_CMS_STATUS_PUBLISHED);
Parameters:
API Tags:
Returns false if any attribute names are empty, or duplicates are found.
API Tags:
string __get(
string
$propName
)
|
|
Returns value property for searched SGL_Attribute.
Parameters:
boolean __set(
string
$propName, string
$propValue
)
|
|
Sets value property for searched SGL_Attribute.
Parameters:
|
string |
$propName: |
|
|
string |
$propValue: |
|