Load the articles content and stores it in the 'content' property of the article object
_getArticleContent() : void
$article->content[type][number] = value;
Contenido API - Article Object
This object represents a Contenido article
Create object with $obj = new Article(idart, client, lang [, idartlang]);
You can now read the article properties with $obj->getField(property);
List of article properties:
idartlang - Language dependant article id idart - Language indepenant article id idclient - Id of the client idtplcfg - Template configuration id title - Internal Title pagetitle - HTML Title summary - Article summary created - Date created lastmodified - Date lastmodiefied author - Article author (username) online - On-/offline redirect - Redirect redirect_url - Redirect URL artsort - Article sort key timemgmt - Time management datestart - Time management start date dateend - Time management end date status - Article status free_use_01 - Free to use free_use_02 - Free to use free_use_03 - Free to use time_move_cat - Move category after time management time_target_cat - Move category to this cat after time management time_online_move - Set article online after move external_redirect - Open article in new window locked - Article is locked for editing
You can extract article content with the $obj->getContent(contype [, number]) method.
To extract the first headline you can use:
$headline = $obj->getContent("htmlhead", 1);
If the second parameter is ommitted the method returns an array with all available content of this type. The array has the following schema:
array( number => content );
$headlines = $obj->getContent("htmlhead");
$headlines[1] First headline $headlines[2] Second headline $headlines[6] Sixth headline
Legal content type string are defined in the Contenido system table 'con_type'. Default content types are:
NOTE: This parameter is case insesitive, you can use html or cms_HTML or CmS_HtMl. Your don't need start with cms, but it won't crash if you do so.
htmlhead - HTML Headline html - HTML Text headline - Headline (no HTML) text - Text (no HTML) img - Upload id of the element imgdescr - Image description link - Link (URL) linktarget - Linktarget (_self, _blank, _top ...) linkdescr - Linkdescription swf - Upload id of the element
author | Timo A. Hummel <Timo.Hummel@4fb.de> |
---|---|
version | 0.1 |
copyright | four for business 2003 |
Article(int $idart, $client, int $lang, $idartlang) : void
int
Article Id
int
Language Id
Item(string $table, string $primaryKey, $lifetime)
inherited_from | \Item::Item() |
---|
string
The table to use as information source
string
The primary key to use
_getArticleContent() : void
$article->content[type][number] = value;
_getIdArtLang(int $idart, int $lang) : int
access | private |
---|
int
Article id
int
Language id
int
Language dependant article id_inFilter(mixed $data) : mixed
see | \setFilters |
---|---|
access | private |
inherited_from | \Item::_inFilter() |
mixed
Data to filter
mixed
Filtered data_onLoad() : \none
Function which is called whenever an item is loaded. Inherited classes should override this function if desired.
inherited_from | \Item::_onLoad() |
---|
\none
_outFilter(mixed $data) : mixed
see | \setFilters |
---|---|
access | private |
inherited_from | \Item::_outFilter() |
mixed
Data to filter
mixed
Filtered data_setMetaObject($objectname)
inherited_from | \Item::_setMetaObject() |
---|
deleteProperty(string $type, string $name)
inherited_from | \Item::deleteProperty() |
---|
string
Specifies the type
string
Specifies the name
get(string $field) : mixed
inherited_from | \Item::get() |
---|
string
Specifies the field to retrieve
mixed
Value of the fieldgetContent(string $type, int $id) : mixed
Returns the specified content element or an array("id"=>"value") if the second parameter is omitted.
Legal content type string are defined in the Contenido system table 'con_type'. Default content types are:
NOTE: Parameter is case insesitive, you can use html or cms_HTML or CmS_HtMl. Your don't need start with cms, but it won't crash if you do so.
htmlhead - HTML Headline html - HTML Text headline - Headline (no HTML) text - Text (no HTML) img - Upload id of the element imgdescr - Image description link - Link (URL) linktarget - Linktarget (_self, _blank, _top ...) linkdescr - Linkdescription swf - Upload id of the element
string
CMS_TYPE - Legal cms type string
int
Id of the content
mixed
String/Array Content DatagetField(string $name) : mixed
List of article properties:
idartlang - Language dependant article id idart - Language indepenant article id idclient - Id of the client idtplcfg - Template configuration id title - Internal Title pagetitle - HTML Title summary - Article summary created - Date created lastmodified - Date lastmodiefied author - Article author (username) online - On-/offline redirect - Redirect redirect_url - Redirect URL artsort - Article sort key timemgmt - Time management datestart - Time management start date dateend - Time management end date status - Article status free_use_01 - Free to use free_use_02 - Free to use free_use_03 - Free to use time_move_cat - Move category after time management time_target_cat - Move category to this cat after time management time_online_move - Set article online after move external_redirect - Open article in new window locked - Article is locked for editing
string
Property name
mixed
Property valuegetMetaObject()
inherited_from | \Item::getMetaObject() |
---|
getProperty(string $type, string $name) : boolean
inherited_from | \Item::getProperty() |
---|
string
Specifies the type
string
Specifies the name
boolean
Value of the given propertyloadBy(string $field, string $value, bool $bSafe) : bool
inherited_from | \Item::loadBy() |
---|
string
Specifies the field
string
Specifies the value
bool
use inFilter or not
bool
True if the load was successfulloadByPrimaryKey(string $value) : bool
inherited_from | \Item::loadByPrimaryKey() |
---|
string
Specifies the primary key value
bool
True if the load was successfulset(string $field, string $value, $safe)
inherited_from | \Item::set() |
---|
string
Specifies the field to set
string
Specifies the value to set
setField(string $field, string $value, boolean $safe)
inherited_from | \Item::setField() |
---|
string
Specifies the field to set
string
Specifies the value to set
boolean
Speficies if we should translate characters
setFilters(array $arrInFilters, array $arrOutFilters) : void
Examples:
$obj->setFilters(array('addslashes'), array('stripslashes')); $obj->setFilters(array('htmlencode', 'addslashes'), array('stripslashes', 'htmlencode'));
inherited_from | \Item::setFilters() |
---|
array
inFilters array with function names
array
outFilters array with function names
setProperty(string $type, string $name, string $value)
inherited_from | \Item::setProperty() |
---|
string
Specifies the type
string
Specifies the name
string
Specifies the value
store() : \none
This Article Object is READ ONLY
access | private |
---|
\none
$_arrInFilters : array
access | private |
---|---|
inherited_from | \Item::$$_arrInFilters |
$_arrOutFilters : array
access | private |
---|---|
inherited_from | \Item::$$_arrOutFilters |
$cache : array
access | private |
---|---|
inherited_from | \Item::$$cache |
$content : array
$db : object
access | private |
---|---|
inherited_from | \Item::$$db |
$lasterror : string
access | private |
---|---|
inherited_from | \Item::$$lasterror |
$lifetime : int
access | private |
---|---|
inherited_from | \Item::$$lifetime |
$modifiedValues : array
access | private |
---|---|
inherited_from | \Item::$$modifiedValues |
$oldPrimaryKey : string
access | private |
---|---|
inherited_from | \Item::$$oldPrimaryKey |
$primaryKey : object
access | private |
---|---|
inherited_from | \Item::$$primaryKey |
$properties : object
access | private |
---|---|
inherited_from | \Item::$$properties |
$tab : array
$table : string
access | private |
---|---|
inherited_from | \Item::$$table |
$values : array
access | private |
---|---|
inherited_from | \Item::$$values |
$virgin : boolean
If true, the object is virgin and no operations on it except load-Functions are allowed.
access | private |
---|---|
inherited_from | \Item::$$virgin |