本文整理汇总了PHP中Kwc_Abstract::hasChildComponentClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Abstract::hasChildComponentClass方法的具体用法?PHP Kwc_Abstract::hasChildComponentClass怎么用?PHP Kwc_Abstract::hasChildComponentClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwc_Abstract
的用法示例。
在下文中一共展示了Kwc_Abstract::hasChildComponentClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListeners
public function getListeners()
{
$ret = array();
foreach (Kwc_Abstract::getComponentClasses() as $class) {
if (in_array('Kwc_Directories_List_Component', Kwc_Abstract::getParentClasses($class)) || in_array('Kwc_Directories_List_Trl_Component', Kwc_Abstract::getParentClasses($class))) {
if (Kwc_Abstract::hasChildComponentClass($class, 'feed') && $this->_class == Kwc_Abstract::getChildComponentClass($class, 'feed')) {
$directoryClasses = call_user_func(array(strpos($class, '.') ? substr($class, 0, strpos($class, '.')) : $class, 'getItemDirectoryClasses'), $class);
foreach ($directoryClasses as $directoryClass) {
$ret[] = array('class' => $directoryClass, 'event' => 'Kwc_Directories_List_EventItemInserted', 'callback' => 'onDirectoryUpdate');
$ret[] = array('class' => $directoryClass, 'event' => 'Kwc_Directories_List_EventItemDeleted', 'callback' => 'onDirectoryUpdate');
$ret[] = array('class' => $directoryClass, 'event' => 'Kwc_Directories_List_EventItemUpdated', 'callback' => 'onDirectoryUpdate');
$ret[] = array('class' => $directoryClass, 'event' => 'Kwc_Directories_List_EventItemsUpdated', 'callback' => 'onDirectoryUpdate');
}
}
}
}
return $ret;
}
示例2: _fireTagEvent
private function _fireTagEvent($event, $directory, $itemId = null)
{
$cacheId = 'kwc-dirlistview-isdata-' . $this->_class;
$dirIs = Kwf_Cache_SimpleStatic::fetch($cacheId);
if ($dirIs === false) {
$dirIs = array('data' => false, 'string' => false);
foreach (Kwc_Abstract::getComponentClasses() as $class) {
if (in_array('Kwc_Directories_List_Component', Kwc_Abstract::getParentClasses($class)) || in_array('Kwc_Directories_List_Trl_Component', Kwc_Abstract::getParentClasses($class))) {
if (Kwc_Abstract::hasChildComponentClass($class, 'child', 'view') && $this->_class == Kwc_Abstract::getChildComponentClass($class, 'child', 'view')) {
$isData = call_user_func(array(strpos($class, '.') ? substr($class, 0, strpos($class, '.')) : $class, 'getItemDirectoryIsData'), $class);
if ($isData) {
$dirIs['data'] = true;
} else {
$dirIs['string'] = true;
}
}
}
}
Kwf_Cache_SimpleStatic::add($cacheId, $dirIs);
}
$event = "Kwf_Component_Event_ComponentClass_Tag_{$event}";
if ($itemId) {
if ($dirIs['data']) {
$this->fireEvent(new $event($this->_class, $directory->componentId, $itemId));
}
if ($dirIs['string']) {
$this->fireEvent(new $event($this->_class, $directory->componentClass, $itemId));
}
} else {
if ($dirIs['data']) {
$this->fireEvent(new $event($this->_class, $directory->componentId));
}
if ($dirIs['string']) {
$this->fireEvent(new $event($this->_class, $directory->componentClass));
}
}
}