Load the articles content and stores it in the 'content' property of the article object
_getArticleContent() : void
$article->content[type][number] = value;
Article()
__construct()
_inFilter()
deleteProperty()
deletePropertyById()
escape()
get()
getContent()
getField()
getIdArtLang()
getMetaObject()
getProperty()
isLoaded()
loadBy()
loadByPrimaryKey()
loadByRecordSet()
set()
setField()
setFilters()
setProperty()
store()
toArray()
toObject()
_getArticleContent()
_getIdArtLang()
_getPropertiesCollectionInstance()
_getSecondDBInstance()
_loadByWhereClause()
_onLoad()
_outFilter()
_setMetaObject()
$content
$primaryKey
$tab
$values
$virgin
$_arrInFilters
$_arrOutFilters
$_className
$_iIdArtLang
$_metaObject
$_oCache
$_settings
$cache
$db
$lasterror
$lifetime
$modifiedValues
$oldPrimaryKey
$properties
$secondDb
$table
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> |
|---|---|
| author | Murat Purc |
| version | 0.3 |
| copyright | four for business 2003 |
Article($idart, $client, $lang, $idartlang)
| deprecated | [2011-03-15] Old constructor function for downwards compatibility |
|---|
__construct(int $idart, $client, int $lang, $idartlang) : void
intArticle Id
intLanguage Id
\Contenido_ItemException |
If table name or primary key is not set |
|---|
_inFilter(mixed $mData) : mixed
| see | \setFilters |
|---|---|
| inherited_from | \Item::_inFilter() |
mixedData to filter
mixedFiltered datadeleteProperty(string $sType, string $sName) : bool
| inherited_from | \Item::deleteProperty() |
|---|
stringSpecifies the type
stringSpecifies the name
booldeletePropertyById(int $idprop) : bool
| inherited_from | \Item::deletePropertyById() |
|---|
intId of property
boolescape(string $sString) : string
| inherited_from | \Contenido_ItemBaseAbstract::escape() |
|---|---|
| inherited_from | \Item::escape() |
stringThe string to escape
stringEscaped stringget(string $sField) : mixed
| inherited_from | \Item::get() |
|---|
stringSpecifies the field to retrieve
mixedValue 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
stringCMS_TYPE - Legal cms type string
intId of the content
mixedString/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
stringProperty name
mixedProperty valuegetIdArtLang() : int
getMetaObject()
| inherited_from | \Item::getMetaObject() |
|---|
getProperty(string $sType, string $sName) : mixed
| inherited_from | \Item::getProperty() |
|---|
stringSpecifies the type
stringSpecifies the name
mixedValue of the given property or falseisLoaded() : bool
| inherited_from | \Item::isLoaded() |
|---|
boolloadBy(string $sField, mixed $mValue, bool $bSafe) : bool
| inherited_from | \Item::loadBy() |
|---|
stringSpecifies the field
mixedSpecifies the value
boolUse inFilter or not
boolTrue if the load was successfulloadByPrimaryKey(string $mValue) : bool
| inherited_from | \Item::loadByPrimaryKey() |
|---|
stringSpecifies the primary key value
boolTrue if the load was successfulloadByRecordSet(array $aRecordSet)
| inherited_from | \Item::loadByRecordSet() |
|---|
arrayThe recordset of the item
set(string $sField, string $mValue, bool $bSafe)
| inherited_from | \Item::set() |
|---|
stringField name
stringValue to set
boolFlag to run defined inFilter on passed value
setField(string $sField, string $mValue, bool $bSafe)
| inherited_from | \Item::setField() |
|---|
stringField name
stringValue to set
boolFlag to run defined inFilter on passed value
setFilters(array $aInFilters, array $aOutFilters) : void
Examples:
$obj->setFilters(array('addslashes'), array('stripslashes'));
$obj->setFilters(array('htmlencode', 'addslashes'), array('stripslashes', 'htmlencode'));
| inherited_from | \Item::setFilters() |
|---|
arrayArray with function names
arrayArray with function names
setProperty(string $sType, string $sName, mixed $mValue) : bool
| inherited_from | \Item::setProperty() |
|---|
stringSpecifies the type
stringSpecifies the name
mixedSpecifies the value
boolstore() : \none
This Article Object is READ ONLY
| access | private |
|---|
\nonetoArray() : array | false
| inherited_from | \Item::toArray() |
|---|
arrayfalse
_getArticleContent() : void
$article->content[type][number] = value;
_getIdArtLang(int $idart, int $lang) : int
| access | private |
|---|
intArticle id
intLanguage id
intLanguage dependant article id_getPropertiesCollectionInstance() : \PropertyCollection
| inherited_from | \Contenido_ItemBaseAbstract::_getPropertiesCollectionInstance() |
|---|---|
| inherited_from | \Item::_getPropertiesCollectionInstance() |
_getSecondDBInstance() : \DB_Contenido
| inherited_from | \Contenido_ItemBaseAbstract::_getSecondDBInstance() |
|---|---|
| inherited_from | \Item::_getSecondDBInstance() |
_loadByWhereClause(string $sWhere) : bool
This function is expensive, since it executes allways a query to the database to retrieve the primary key, even if the record set is aleady cached. NOTE: Passed value has to be escaped before. This will not be done by this function.
| inherited_from | \Item::_loadByWhereClause() |
|---|
stringThe where clause like 'idart = 123 AND idlang = 1'
boolTrue if the load was successful_onLoad() : void
Inherited classes should override this function if desired.
| inherited_from | \Item::_onLoad() |
|---|
_outFilter(mixed $mData) : mixed
| see | \setFilters |
|---|---|
| inherited_from | \Item::_outFilter() |
mixedData to filter
mixedFiltered data_setMetaObject($sObjectName)
| inherited_from | \Item::_setMetaObject() |
|---|
$content : array
$primaryKey : string
| inherited_from | \Contenido_ItemBaseAbstract::$$primaryKey |
|---|---|
| inherited_from | \Item::$$primaryKey |
$tab : array
$values : array
| inherited_from | \Item::$$values |
|---|
$virgin : bool
| inherited_from | \Contenido_ItemBaseAbstract::$$virgin |
|---|---|
| inherited_from | \Item::$$virgin |
$_arrInFilters : array
| inherited_from | \Item::$$_arrInFilters |
|---|
$_arrOutFilters : array
| inherited_from | \Item::$$_arrOutFilters |
|---|
$_className : string
| inherited_from | \Contenido_ItemBaseAbstract::$$_className |
|---|---|
| inherited_from | \Item::$$_className |
$_iIdArtLang : int
$_oCache : \Contenido_ItemCache
| inherited_from | \Contenido_ItemBaseAbstract::$$_oCache |
|---|---|
| inherited_from | \Item::$$_oCache |
$_settings : array
| inherited_from | \Contenido_ItemBaseAbstract::$$_settings |
|---|---|
| inherited_from | \Item::$$_settings |
$cache : array
| inherited_from | \Contenido_ItemBaseAbstract::$$cache |
|---|---|
| inherited_from | \Item::$$cache |
$db : \DB_Contenido
| inherited_from | \Contenido_ItemBaseAbstract::$$db |
|---|---|
| inherited_from | \Item::$$db |
$lasterror : string
| inherited_from | \Contenido_ItemBaseAbstract::$$lasterror |
|---|---|
| inherited_from | \Item::$$lasterror |
$lifetime : int
| inherited_from | \Contenido_ItemBaseAbstract::$$lifetime |
|---|---|
| inherited_from | \Item::$$lifetime |
$modifiedValues : array
| inherited_from | \Item::$$modifiedValues |
|---|
$oldPrimaryKey : string
| inherited_from | \Item::$$oldPrimaryKey |
|---|
$properties : \PropertyCollection
| inherited_from | \Contenido_ItemBaseAbstract::$$properties |
|---|---|
| inherited_from | \Item::$$properties |
$secondDb : \DB_Contenido
| inherited_from | \Contenido_ItemBaseAbstract::$$secondDb |
|---|---|
| inherited_from | \Item::$$secondDb |
$table : string
| inherited_from | \Contenido_ItemBaseAbstract::$$table |
|---|---|
| inherited_from | \Item::$$table |