本文整理汇总了PHP中Kwc_Abstract::getIndirectChildComponentClasses方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Abstract::getIndirectChildComponentClasses方法的具体用法?PHP Kwc_Abstract::getIndirectChildComponentClasses怎么用?PHP Kwc_Abstract::getIndirectChildComponentClasses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwc_Abstract
的用法示例。
在下文中一共展示了Kwc_Abstract::getIndirectChildComponentClasses方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBoxes
public function testBoxes()
{
$page = $this->_root->getComponentById('1');
$this->assertNotNull($page);
$boxes = $page->getRecursiveChildComponents(array('box' => true, 'page' => false));
$this->assertEquals(1, count($boxes));
$classes = Kwc_Abstract::getIndirectChildComponentClasses('Kwf_Component_Generator_Boxes_Root', array('inherit' => true));
$this->assertEquals(array(), $classes);
}
示例2: testIndirect
public function testIndirect()
{
$classes = Kwc_Abstract::getIndirectChildComponentClasses('Kwf_Component_Generator_Indirect_Root', array('flags' => array('foo' => true)));
$this->assertEquals(1, count($classes));
$this->assertEquals('Kwf_Component_Generator_Indirect_Flag', current($classes));
$classes = Kwc_Abstract::getIndirectChildComponentClasses('Kwf_Component_Generator_Indirect_Root', array('flags' => array('bar' => true)));
$this->assertEquals(1, count($classes));
$this->assertEquals('Kwf_Component_Generator_Indirect_Flag', current($classes));
$classes = Kwc_Abstract::getIndirectChildComponentClasses('Kwf_Component_Generator_Indirect_Root', array('flags' => array('foobar' => true)));
$this->assertEquals(1, count($classes));
$this->assertEquals('Kwf_Component_Generator_Indirect_Flag', current($classes));
}
示例3: testInherit
public function testInherit()
{
$c = $this->_root->getChildComponent('_static')->getChildComponents();
$this->assertEquals(count($c), 1);
$this->assertEquals(current($c)->componentId, 'root_static-box');
$c = $this->_root->getChildComponent('_static')->getChildBoxes();
$this->assertEquals(1, count($c));
$this->assertEquals('root_static-box', current($c)->componentId);
$cc = Kwc_Abstract::getIndirectChildComponentClasses('Kwf_Component_Generator_Inherit_Root', array('flags' => array('foo' => true)));
$this->assertEquals(1, count($cc));
$this->assertEquals('Kwf_Component_Generator_Inherit_Box', current($cc));
$c = $this->_root->getChildComponent('_static');
$cc = current($c->getChildComponents(array('hasEditComponents' => true)));
$this->assertEquals('root_static-box', $cc->componentId);
$c = $c->getRecursiveChildComponents(array('flags' => array('foo' => true)));
$this->assertEquals(1, count($c));
$this->assertEquals(current($c)->componentId, 'root_static-box-flag');
$this->assertNotNull($this->_root->getComponentById('root_static-box'));
$this->assertEquals($this->_root->getComponentById('root_static-box')->componentId, 'root_static-box');
$this->assertEquals($this->_root->getComponentById('root_static-box-flag')->componentId, 'root_static-box-flag');
}
示例4: _getPossibleIndirectDbIdShortcutsImpl
private function _getPossibleIndirectDbIdShortcutsImpl($class)
{
if (isset($this->_getPossibleIndirectDbIdShortcutsCache[$class])) {
return $this->_getPossibleIndirectDbIdShortcutsCache[$class];
}
$ret = array();
$gens = Kwf_Component_Generator_Abstract::getInstances($class);
foreach ($gens as $g) {
// Do not return page generators
// For Page generators the dbIdShortcut is only used for components below the current
// page in models
if (!$g->getGeneratorFlag('page') && $g->hasSetting('dbIdShortcut') && Kwc_Abstract::getIndirectChildComponentClasses($class, array('componentClass' => $this->_class))) {
$ret[] = $g->getSetting('dbIdShortcut');
}
}
$this->_getPossibleIndirectDbIdShortcutsCache[$class] = $ret;
foreach (Kwc_Abstract::getChildComponentClasses($class, array('page' => false)) as $c) {
$ret = array_merge($ret, $this->_getPossibleIndirectDbIdShortcutsImpl($c));
}
$this->_getPossibleIndirectDbIdShortcutsCache[$class] = $ret;
return $ret;
}
示例5: testFlag
public function testFlag()
{
$this->assertEquals(count(Kwc_Abstract::getIndirectChildComponentClasses('Kwf_Component_Generator_Recursive_Static', array('flags' => array('foo' => true)))), 1);
$this->_assertRecursiveIds($this->_root->getChildComponent('_static'), array('flags' => array('foo' => true)), array('root_static-static2-flag'));
}
示例6: _formatChildConstraints
private function _formatChildConstraints($select, $childSelect)
{
$childSelect = clone $childSelect;
$select = clone $select;
if ($select->hasPart(Kwf_Model_Select::LIMIT_COUNT)) {
$select->unsetPart(Kwf_Model_Select::LIMIT_COUNT);
}
if ($select->hasPart(Kwf_Component_Select::WHERE_FILENAME)) {
$select->unsetPart(Kwf_Component_Select::WHERE_FILENAME);
}
if ($select->hasPart(Kwf_Component_Select::WHERE_HOME)) {
$select->unsetPart(Kwf_Component_Select::WHERE_HOME);
}
$classes = Kwc_Abstract::getIndirectChildComponentClasses($this->componentClass, $select);
$page = $this;
$ic = $this->inheritClasses;
foreach ($ic as $c) {
$classes = array_merge($classes, Kwc_Abstract::getIndirectChildComponentClasses($c, $select));
}
// Nur bei hasEditComponents, Root soll keine Domain-Komponenten anzeigen
// Hack-Alarm :D
if ($select->hasPart(Kwf_Component_Select::WHERE_HAS_EDIT_COMPONENTS) && $this instanceof Kwf_Component_Data_Root) {
$cc = array();
foreach ($classes as $class) {
if (!is_instance_of($class, 'Kwc_Root_DomainRoot_Domain_Component')) {
$cc[] = $class;
}
}
$classes = $cc;
}
$childSelect->whereComponentClasses(array_unique($classes));
return $childSelect;
}
示例7: _assertRec
private function _assertRec($constraints, $count)
{
$classes = Kwc_Abstract::getIndirectChildComponentClasses('Kwf_Component_Generator_Components_Recursive', $constraints);
$this->assertEquals($count, count($classes));
}