Component/Data.php
- 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 Constants
- DEVICE_VISIBLE_ALL
- DEVICE_VISIBLE_HIDE_ON_MOBILE
- DEVICE_VISIBLE_ONLY_SHOW_ON_MOBILE
 Methods 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
 Details
- value
- all
DEVICE_VISIBLE_HIDE_ON_MOBILE
 DEVICE_VISIBLE_HIDE_ON_MOBILE = 'hideOnMobile'
      
 Details
 Details
- value
- hideOnMobile
DEVICE_VISIBLE_ONLY_SHOW_ON_MOBILE
 DEVICE_VISIBLE_ONLY_SHOW_ON_MOBILE = 'onlyShowOnMobile'
      
 Details
 Details
- value
- onlyShowOnMobile
Methods
__destruct
__destruct(
          
          )
        
        :
        
 Details
 Details
- visibility
- public
- final
- false
- static
- false
__get
__get(
           $var
          )
        
        :
        Arguments
- $var
 Details
 Details
- visibility
- public
- final
- false
- static
- false
_getPseudoPageUrl
_getPseudoPageUrl(
          
          )
        
        :
        Like ->url but also works for pseudoPages
overridden in Data_Home
 Details
 Details
- visibility
- protected
- final
- false
- static
- false
countChildComponents
countChildComponents(
           $select
              =
              array
          )
        
        :
        intreturns 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
 Details
- visibility
- public
- final
- false
- static
- false
getAbsoluteUrl
getAbsoluteUrl(
           $useHttps
              =
              false
          )
        
        :
        stringReturns absolute url including domain and protocol (http://)
Arguments
- $useHttps
Output
- string
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getBaseProperty
getBaseProperty(
          string $propertyName
          )
        
        :
        stringRetrieves 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
 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
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getChildComponent
getChildComponent(
           $select
              =
              array
          )
        
        :
        \Kwf_Component_DataReturns a single direct child component
Arguments
- $select
Output
 Details
 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
Output
 Details
 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
 Details
- visibility
- public
- final
- false
- static
- false
getChildPage
getChildPage(
           $select
              =
              array,  $childSelect
              =
              array
          )
        
        :
        \Kwf_Component_DataReturns a single child page
Arguments
- $select
- $childSelect
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
- see
- getChildPages
getChildPageByPath
getChildPageByPath(
           $path
          )
        
        :
        \Kwf_Component_DataSearches for a child page by a given path
Should only be used to resolve incoming paths
Arguments
- $path
- string
Output
 Details
 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
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getChildPseudoPage
getChildPseudoPage(
           $select
              =
              array
          )
        
        :
        \Kwf_Component_DataReturns a single child pseudo page
Arguments
- $select
Output
 Details
 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
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getComponent
getComponent(
          
          )
        
        :
        \Kwc_AbstractReturns the Component object of to this data
Output
- \Kwc_Abstract
 Details
 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
 Details
- visibility
- public
- final
- true
- static
- false
getDomain
getDomain(
          
          )
        
        :
        stringReturns domain for current component
Output
- string
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getExpandedComponentId
getExpandedComponentId(
          
          )
        
        :
        stringReturns component_id with seperate entries from every page in tree
Output
- string
 Details
 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_AbstractReturns a generator of this data
shortcut for Kwf_Component_Generator_Abstract::getInstance($data->componentClass, $key);
Arguments
- $key
- string
 generator key
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getLanguage
getLanguage(
          
          )
        
        :
        stringReturns the language used by this data
Output
- string
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getPage
getPage(
          
          )
        
        :
        \Kwf_Component_DataReturns the page this data belongs to (might be a page itself)
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getPageOrRoot
getPageOrRoot(
          
          )
        
        :
        \Kwf_Component_DataReturns the page this data belongs to (might be a page itself) OR (if there is no page) the root component
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getParentByClass
getParentByClass(
          string|array $cls
          )
        
        :
        \Kwf_Component_DataReturns the parent matching a given component class
Arguments
- $cls
- stringarray
 component class or array of component classes
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getParentComponent
getParentComponent(
          int $numParent
              =
              1
          )
        
        :
        \Kwf_Component_DataReturns 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
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getParentComponentId
getParentComponentId(
          int $numParent
              =
              1
          )
        
        :
        \Kwf_Component_DataReturns 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
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getParentPage
getParentPage(
          
          )
        
        :
        \Kwf_Component_DataReturns the parent page of this data
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getParentPageOrRoot
getParentPageOrRoot(
          
          )
        
        :
        \Kwf_Component_DataReturns the parent page OR (if there is no none) the root component
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getParentPseudoPage
getParentPseudoPage(
          
          )
        
        :
        \Kwf_Component_DataReturns the parent pseudo page of this data
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getParentPseudoPageOrRoot
getParentPseudoPageOrRoot(
          
          )
        
        :
        \Kwf_Component_DataReturns the parent pseudo page OR (if there is no none) the root component
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getPreviewUrl
getPreviewUrl(
          
          )
        
        :
        stringReturns preview url
Output
- string
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getPseudoPage
getPseudoPage(
          
          )
        
        :
        \Kwf_Component_DataReturns the pseudo page this data belongs to (might be a pseudo page itself)
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getPseudoPageOrRoot
getPseudoPageOrRoot(
          
          )
        
        :
        \Kwf_Component_DataReturns the psuedo page or pagethis data belongs to (might be a page itself) OR (if there is no page) the root component
Output
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getRecursiveChildComponent
getRecursiveChildComponent(
           $select
              =
              array,  $childSelect
              =
              array
          )
        
        :
        \Kwf_Component_DataReturns a single child component
Arguments
- $select
- $childSelect
Output
 Details
 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
 Details
- visibility
- public
- final
- false
- static
- false
getSubroot
getSubroot(
          
          )
        
        :
        
 Details
 Details
- visibility
- public
- final
- false
- static
- false
getTitle
getTitle(
          
          )
        
        :
        stringReturns the title of the page
Can be overridden to customize.
By default names of parent pages will be used
Output
- string
 Details
 Details
- visibility
- public
- final
- false
- static
- false
hasContent
hasContent(
          
          )
        
        :
        boolReturns if the component has content
Shortcut for $this->getComponent()->hasContent()
Output
- bool
 Details
 Details
- visibility
- public
- final
- false
- static
- false
isShownInMenu
isShownInMenu(
          
          )
        
        :
        boolReturns 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
 Details
- visibility
- public
- final
- false
- static
- false
isVisible
isVisible(
          
          )
        
        :
        boolReturns if this component is visible
A component is visible if all parents are visible.
Output
- bool
 Details
 Details
- visibility
- public
- final
- false
- static
- false
render
render(
          bool $enableCache
              =
              null, bool $renderMaster
              =
              false,  $hasDynamicParts
              =
              false
          )
        
        :
        stringRender 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
 Details
- visibility
- public
- final
- false
- static
- false
trl
trl(
           $string,  $text
              =
              array
          )
        
        :
        Arguments
- $string
- $text
 Details
 Details
- visibility
- public
- final
- false
- static
- false
trlKwf
trlKwf(
           $string,  $text
              =
              array
          )
        
        :
        Arguments
- $string
- $text
 Details
 Details
- visibility
- public
- final
- false
- static
- false
trlStaticExecute
trlStaticExecute(
           $trlStaticData
          )
        
        :
        Arguments
- $trlStaticData
 Details
 Details
- visibility
- public
- final
- false
- static
- false
trlc
trlc(
           $context,  $string,  $text
              =
              array
          )
        
        :
        Arguments
- $context
- $string
- $text
 Details
 Details
- visibility
- public
- final
- false
- static
- false
trlcKwf
trlcKwf(
           $context,  $string,  $text
              =
              array
          )
        
        :
        Arguments
- $context
- $string
- $text
 Details
 Details
- visibility
- public
- final
- false
- static
- false
trlcp
trlcp(
           $context,  $single,  $plural,  $text
              =
              array
          )
        
        :
        Arguments
- $context
- $single
- $plural
- $text
 Details
 Details
- visibility
- public
- final
- false
- static
- false
trlcpKwf
trlcpKwf(
           $context,  $single,  $plural,  $text
              =
              array
          )
        
        :
        Arguments
- $context
- $single
- $plural
- $text
 Details
 Details
- visibility
- public
- final
- false
- static
- false
trlp
trlp(
           $single,  $plural,  $text
              =
              array
          )
        
        :
        Arguments
- $single
- $plural
- $text
 Details
 Details
- visibility
- public
- final
- false
- static
- false
trlpKwf
trlpKwf(
           $single,  $plural,  $text
              =
              array
          )
        
        :
        Arguments
- $single
- $plural
- $text
 Details
 Details
- visibility
- public
- final
- false
- static
- false