本文整理匯總了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));
}
}
}