Component/Data.php

Classes 
package
Components
property
string $componentId unique componentId of this data
property
string $dbId dbId of this data
property
string $componentClass component class of this data
property
int $id id of this data, excluding parants
property
Kwf_Comonent_Generator_Abstract $generator generator that created this data
property
Kwf_Component_Data $parent parent data
property
string $url url pointing to the page of this data, generated from filename property of parents
property
string $rel rel attribute when url is used in an a-tag
property
string $filename (only if page): the filename of this data, used to generate urls
property
Kwf_Model_Row_Interface $row only if created by table generator: row assigned to this data
property
bool $isPage true if this data represents a page
property
bool $isPseudopage true if this data represents a page
Classes
Kwf_Component_Data

Description

\Kwf_Component_Data

package
Components
property
string $componentId unique componentId of this data
property
string $dbId dbId of this data
property
string $componentClass component class of this data
property
int $id id of this data, excluding parants
property
Kwf_Comonent_Generator_Abstract $generator generator that created this data
property
Kwf_Component_Data $parent parent data
property
string $url url pointing to the page of this data, generated from filename property of parents
property
string $rel rel attribute when url is used in an a-tag
property
string $filename (only if page): the filename of this data, used to generate urls
property
Kwf_Model_Row_Interface $row only if created by table generator: row assigned to this data
property
bool $isPage true if this data represents a page
property
bool $isPseudopage true if this data represents a page
Constants
DEVICE_VISIBLE_ALL
DEVICE_VISIBLE_HIDE_ON_MOBILE
DEVICE_VISIBLE_ONLY_SHOW_ON_MOBILE
Methods
__destruct
__get
_getPseudoPageUrl
countChildComponents
getAbsoluteUrl
getBaseProperty
getChildBoxes
getChildComponent
getChildComponents
getChildIds
getChildPage
getChildPageByPath
getChildPages
getChildPseudoPage
getChildPseudoPages
getComponent
getDeviceVisible
getDomain
getExpandedComponentId
getGenerator
getLanguage
getPage
getPageOrRoot
getParentByClass
getParentComponent
getParentComponentId
getParentPage
getParentPageOrRoot
getParentPseudoPage
getParentPseudoPageOrRoot
getPreviewUrl
getPseudoPage
getPseudoPageOrRoot
getRecursiveChildComponent
getRecursiveChildComponents
getSubroot
getTitle
hasContent
isShownInMenu
isVisible
render
trl
trlKwf
trlStaticExecute
trlc
trlcKwf
trlcp
trlcpKwf
trlp
trlpKwf

Description

Constants

DEVICE_VISIBLE_ALL

 DEVICE_VISIBLE_ALL = 'all'

Details

value
all

DEVICE_VISIBLE_HIDE_ON_MOBILE

 DEVICE_VISIBLE_HIDE_ON_MOBILE = 'hideOnMobile'

Details

value
hideOnMobile

DEVICE_VISIBLE_ONLY_SHOW_ON_MOBILE

 DEVICE_VISIBLE_ONLY_SHOW_ON_MOBILE = 'onlyShowOnMobile'

Details

value
onlyShowOnMobile

Methods

__destruct

__destruct( ) :
Details
visibility
public
final
false
static
false

__get

__get(  $var ) :
Arguments
$var
Details
visibility
public
final
false
static
false

_getPseudoPageUrl

_getPseudoPageUrl( ) :

Like ->url but also works for pseudoPages

overridden in Data_Home

Details
visibility
protected
final
false
static
false

countChildComponents

countChildComponents(  $select = array ) : int

returns the number of child components for a single generator

Only works for a single generator - you have to specify the required generator.

This is much more efficient than count(->getChildComponents()) as it will result in an SELECT COUNT() sql query

Arguments
$select
array|Kwf_Component_Select
Output
int
Details
visibility
public
final
false
static
false

getAbsoluteUrl

getAbsoluteUrl(  $useHttps = false ) : string

Returns absolute url including domain and protocol (http://)

Arguments
$useHttps
Output
string
Details
visibility
public
final
false
static
false

getBaseProperty

getBaseProperty( string $propertyName ) : string

Retrieves a base Property for a component

Any component can add a flag called 'hasBaseProperties' and implement getBaseProperties($propertyName) to return a property specific for this component and all child components (e.g. language, domain, id for analytics...) It's also possible to specify the returned property by adding an array "baseProperties" to the settings. This may help some to exclude components to be asked for base Properties which they actually don't return.

Arguments
$propertyName
string
Output
string
Property
Details
visibility
public
final
false
static
false

getChildBoxes

getChildBoxes(  $select = array ) : \Kwf_Component_Data[]

Returns child boxes matching the given select

Not only direct children will be returned, also boxes created by child components.

Arguments
$select
array|Kwf_Component_Select
Details
visibility
public
final
false
static
false

getChildComponent

getChildComponent(  $select = array ) : \Kwf_Component_Data

Returns a single direct child component

Arguments
$select
Details
visibility
public
final
false
static
false
see
getChildComponents

getChildComponents

getChildComponents(  $select = array ) : \Kwf_Component_Data[]

Returns child components matching the given select

Arguments
$select
array|Kwf_Component_Select
Details
visibility
public
final
false
static
false

getChildIds

getChildIds(  $select = array ) : \int[]

Returns child ids for a single generator

Only works for a single generator - you have to specify the required generator.

This is much more efficient than getChildComponents as no rows or data objects will be created.

Arguments
$select
array|Kwf_Component_Select
Output
\int[]
Details
visibility
public
final
false
static
false

getChildPage

getChildPage(  $select = array,  $childSelect = array ) : \Kwf_Component_Data

Returns a single child page

Arguments
$select
$childSelect
Details
visibility
public
final
false
static
false
see
getChildPages

getChildPageByPath

getChildPageByPath(  $path ) : \Kwf_Component_Data

Searches for a child page by a given path

Should only be used to resolve incoming paths

Arguments
$path
string
Details
visibility
public
final
false
static
false

getChildPages

getChildPages( array|\Kwf_Component_Select $select = array, array|\Kwf_Component_Select $childSelect = array ) : \Kwf_Component_Data[]

Returns child pages matching the given select

Not only direct children will be returned, also pages created by child components.

Arguments
$select
array\Kwf_Component_Select
additional constraints
$childSelect
array\Kwf_Component_Select
constraints on how deep indirect child pages will be returned
Details
visibility
public
final
false
static
false

getChildPseudoPage

getChildPseudoPage(  $select = array ) : \Kwf_Component_Data

Returns a single child pseudo page

Arguments
$select
Details
visibility
public
final
false
static
false
see
getChildPseudoPages

getChildPseudoPages

getChildPseudoPages( array|\Kwf_Component_Select $select = array, array|\Kwf_Component_Select $childSelect = array ) : \Kwf_Component_Data[]

Returns child pseudo pages matching the given select

Not only direct children will be returned, also pseudo pages created by child components.

Arguments
$select
array\Kwf_Component_Select
additional constraints
$childSelect
array\Kwf_Component_Select
constraints on how deep indirect child pseudo pages will be returned
Details
visibility
public
final
false
static
false

getComponent

getComponent( ) : \Kwc_Abstract

Returns the Component object of to this data

Output
\Kwc_Abstract
Details
visibility
public
final
false
static
false

getDeviceVisible

getDeviceVisible( ) :

Returns on which devices this page should be visible

DEVICE_VISIBLE_* constants are returned. Implement getDeviceVisible in generator to change behaviour.

Details
visibility
public
final
true
static
false

getDomain

getDomain( ) : string

Returns domain for current component

Output
string
Details
visibility
public
final
false
static
false

getExpandedComponentId

getExpandedComponentId( ) : string

Returns component_id with seperate entries from every page in tree

Output
string
Details
visibility
public
final
false
static
false
example
root |-1 |-2 |-3 componentId: 3, expandedComponentId: root-1_2_3

getGenerator

getGenerator( string $key ) : \Kwf_Component_Generator_Abstract

Returns a generator of this data

shortcut for Kwf_Component_Generator_Abstract::getInstance($data->componentClass, $key);

Arguments
$key
string
generator key
Details
visibility
public
final
false
static
false

getLanguage

getLanguage( ) : string

Returns the language used by this data

Output
string
Details
visibility
public
final
false
static
false

getPage

getPage( ) : \Kwf_Component_Data

Returns the page this data belongs to (might be a page itself)

Details
visibility
public
final
false
static
false

getPageOrRoot

getPageOrRoot( ) : \Kwf_Component_Data

Returns the page this data belongs to (might be a page itself) OR (if there is no page) the root component

Details
visibility
public
final
false
static
false

getParentByClass

getParentByClass( string|array $cls ) : \Kwf_Component_Data

Returns the parent matching a given component class

Arguments
$cls
stringarray
component class or array of component classes
Details
visibility
public
final
false
static
false

getParentComponent

getParentComponent( int $numParent = 1 ) : \Kwf_Component_Data

Returns a parent component from a given depth

more efficient than getting ->parent multiple times (only if data was unserialized)

Arguments
$numParent
int
levels to go up
Details
visibility
public
final
false
static
false

getParentComponentId

getParentComponentId( int $numParent = 1 ) : \Kwf_Component_Data

Returns a parent component id from a given depth

more efficient than getting ->parent multiple times (only if data was unserialized)

Arguments
$numParent
int
levels to go up
Details
visibility
public
final
false
static
false

getParentPage

getParentPage( ) : \Kwf_Component_Data

Returns the parent page of this data

Details
visibility
public
final
false
static
false

getParentPageOrRoot

getParentPageOrRoot( ) : \Kwf_Component_Data

Returns the parent page OR (if there is no none) the root component

Details
visibility
public
final
false
static
false

getParentPseudoPage

getParentPseudoPage( ) : \Kwf_Component_Data

Returns the parent pseudo page of this data

Details
visibility
public
final
false
static
false

getParentPseudoPageOrRoot

getParentPseudoPageOrRoot( ) : \Kwf_Component_Data

Returns the parent pseudo page OR (if there is no none) the root component

Details
visibility
public
final
false
static
false

getPreviewUrl

getPreviewUrl( ) : string

Returns preview url

Output
string
Details
visibility
public
final
false
static
false

getPseudoPage

getPseudoPage( ) : \Kwf_Component_Data

Returns the pseudo page this data belongs to (might be a pseudo page itself)

Details
visibility
public
final
false
static
false

getPseudoPageOrRoot

getPseudoPageOrRoot( ) : \Kwf_Component_Data

Returns the psuedo page or pagethis data belongs to (might be a page itself) OR (if there is no page) the root component

Details
visibility
public
final
false
static
false

getRecursiveChildComponent

getRecursiveChildComponent(  $select = array,  $childSelect = array ) : \Kwf_Component_Data

Returns a single child component

Arguments
$select
$childSelect
Details
visibility
public
final
false
static
false
see
getRecursiveChildComponents

getRecursiveChildComponents

getRecursiveChildComponents( \Kwf_Component_Select|array $select = array, \Kwf_Component_Select|array $childSelect = array ) : \array(Kwf_Component_Data)

Returns child components recursively

This method usually is very efficient and tries to create as less data objects as possible. It is still a complex operation thus should not get called too often.

Arguments
$select
\Kwf_Component_Selectarray
what to search for
$childSelect
\Kwf_Component_Selectarray
how deep to search
Output
\array(Kwf_Component_Data)
Details
visibility
public
final
false
static
false

getSubroot

getSubroot( ) :
Details
visibility
public
final
false
static
false

getTitle

getTitle( ) : string

Returns the title of the page

Can be overridden to customize.

By default names of parent pages will be used

Output
string
Details
visibility
public
final
false
static
false

hasContent

hasContent( ) : bool

Returns if the component has content

Shortcut for $this->getComponent()->hasContent()

Output
bool
Details
visibility
public
final
false
static
false

isShownInMenu

isShownInMenu( ) : bool

Returns if this page should be shown in menus

Category_Generators can change that dynamically using the hide column, other generators have a 'showInMenu' setting (defaults to false)

Output
bool
Details
visibility
public
final
false
static
false

isVisible

isVisible( ) : bool

Returns if this component is visible

A component is visible if all parents are visible.

Output
bool
Details
visibility
public
final
false
static
false

render

render( bool $enableCache = null, bool $renderMaster = false,  $hasDynamicParts = false ) : string

Render the component

Usually only used internally or for debugging

Arguments
$enableCache
bool
if view cache should be used, if null config setting will be used
$renderMaster
bool
if master should be rendered
$hasDynamicParts
Output
string
Details
visibility
public
final
false
static
false

trl

trl(  $string,  $text = array ) :
Arguments
$string
$text
Details
visibility
public
final
false
static
false

trlKwf

trlKwf(  $string,  $text = array ) :
Arguments
$string
$text
Details
visibility
public
final
false
static
false

trlStaticExecute

trlStaticExecute(  $trlStaticData ) :
Arguments
$trlStaticData
Details
visibility
public
final
false
static
false

trlc

trlc(  $context,  $string,  $text = array ) :
Arguments
$context
$string
$text
Details
visibility
public
final
false
static
false

trlcKwf

trlcKwf(  $context,  $string,  $text = array ) :
Arguments
$context
$string
$text
Details
visibility
public
final
false
static
false

trlcp

trlcp(  $context,  $single,  $plural,  $text = array ) :
Arguments
$context
$single
$plural
$text
Details
visibility
public
final
false
static
false

trlcpKwf

trlcpKwf(  $context,  $single,  $plural,  $text = array ) :
Arguments
$context
$single
$plural
$text
Details
visibility
public
final
false
static
false

trlp

trlp(  $single,  $plural,  $text = array ) :
Arguments
$single
$plural
$text
Details
visibility
public
final
false
static
false

trlpKwf

trlpKwf(  $single,  $plural,  $text = array ) :
Arguments
$single
$plural
$text
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox 0.12.3.