KWeb  6.4
KWebContent Class Reference

Content description class. More...

Public Member Functions

 __construct ($meta=null, $content=null)
 addMeta ($name, $value=null, $lang=false, $append=false)
 addDate ($name, $value=null, $lang=false)
 addContent ($name, $value=null, $lang=false, $append=true)
 getValues ($type=false, $lang=false, $includeLang=false)
 Returns all fields of specified type and language.
 getStrings ($type=false, $lang=false, $includeLang=false)
 Returns all fields of specified type and language as strings.
 getValue ($name=false, $lang=false, $includeLang=false)
 Returns all fields of specified type and language.
 getLanguages ($includeNonTranslateable)
 convertToString ($name, $value=null, $type=null)
 addField ($type, $name, $value=null, $lang=false, $append=false)
 Adds a field to the content.

Data Fields

const GENRE = 'genre'
const ID = 'id'
const STATUS = 'status'
const TYPE = 'type'
const OWNER = 'owner'
const SECTION = 'section'
const TITLE = 'title'
const INFO = 'info'
const CONTENT = 'content'
const KEYWORDS = 'keywords'
 array
const CREATED = 'created'
const MODIFIED = 'modified'
const VISIBLE = 'visible'
const HIDDEN = 'hidden'
const VIEWABLE = 'viewable'
 boolean Is it viewable by anonymous user?
const NAME = 'name'
const URL = 'url'
const FILE = 'file'
const FOREIGN_ID = 'foreign'
const LANG = 'lang'
const SCORE = 'score'
const OFFSET = 'offset'
const TYPE_CONTENT = 'content'
const TYPE_META = 'meta'
const TYPE_DATE = 'date'

Protected Attributes

 $data = array()
 $fields = array()

Detailed Description

Content description class.


Constructor & Destructor Documentation

KWebContent::__construct ( meta = null,
content = null 
)

Member Function Documentation

KWebContent::addContent ( name,
value = null,
lang = false,
append = true 
)
Returns:
KWebContent
KWebContent::addDate ( name,
value = null,
lang = false 
)
Returns:
KWebContent
KWebContent::addField ( type,
name,
value = null,
lang = false,
append = false 
)

Adds a field to the content.

Parameters:
$typeType of field (FIELD_META, FIELD_DATE, FIELD_CONTENT)
$nameName of field or array of fields (name => value, name => value)
$valueValue of field, or null if fields are passed as array through $name
$langLanguage of data, or false for no language
$appendTRUE to append to existing data
Returns:
KWebContent
KWebContent::addMeta ( name,
value = null,
lang = false,
append = false 
)
Returns:
KWebContent
KWebContent::convertToString ( name,
value = null,
type = null 
)
KWebContent::getLanguages ( includeNonTranslateable)
Returns:
array List of languages (including false for non-translateable content)
KWebContent::getStrings ( type = false,
lang = false,
includeLang = false 
)

Returns all fields of specified type and language as strings.

Parameters:
$typeFALSE for all field types, or one of TYPE_* values
$langFALSE for non-translateable content, or language id
$includeLangIncludes another language in the result, TRUE for non-translateable content, or language id
KWebContent::getValue ( name = false,
lang = false,
includeLang = false 
)

Returns all fields of specified type and language.

Parameters:
$langFALSE for non-translateable content, or language id
$includeLangIncludes another language in the result, TRUE for non-translateable content, or language id
KWebContent::getValues ( type = false,
lang = false,
includeLang = false 
)

Returns all fields of specified type and language.

Parameters:
$typeFALSE for all field types, or one of TYPE_* values
$langFALSE for non-translateable content, or language id
$includeLangIncludes another language in the result, TRUE for non-translateable content, or language id

Field Documentation

KWebContent::$data = array() [protected]
KWebContent::$fields = array() [protected]
const KWebContent::CONTENT = 'content'
const KWebContent::CREATED = 'created'
const KWebContent::FILE = 'file'
const KWebContent::FOREIGN_ID = 'foreign'
const KWebContent::GENRE = 'genre'
const KWebContent::HIDDEN = 'hidden'
const KWebContent::ID = 'id'
const KWebContent::INFO = 'info'
const KWebContent::KEYWORDS = 'keywords'

array

const KWebContent::LANG = 'lang'
const KWebContent::MODIFIED = 'modified'
const KWebContent::NAME = 'name'
const KWebContent::OFFSET = 'offset'
const KWebContent::OWNER = 'owner'
const KWebContent::SCORE = 'score'
const KWebContent::SECTION = 'section'
const KWebContent::STATUS = 'status'
const KWebContent::TITLE = 'title'
const KWebContent::TYPE = 'type'
const KWebContent::TYPE_CONTENT = 'content'
const KWebContent::TYPE_DATE = 'date'
const KWebContent::TYPE_META = 'meta'
const KWebContent::URL = 'url'
const KWebContent::VIEWABLE = 'viewable'

boolean Is it viewable by anonymous user?

const KWebContent::VISIBLE = 'visible'

The documentation for this class was generated from the following file: