• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_instance_of函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_instance_of函数的典型用法代码示例。如果您正苦于以下问题:PHP is_instance_of函数的具体用法?PHP is_instance_of怎么用?PHP is_instance_of使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_instance_of函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _getSelect

 protected function _getSelect()
 {
     //$ret = parent::_getSelect(); what do we lose by not using that?
     if ($this->_getParam('filterComponentId')) {
         $filter = Kwf_Component_Data_Root::getInstance()->getComponentById($this->_getParam('filterComponentId'));
         if (!is_instance_of($filter->componentClass, 'Kwc_Directories_List_Component')) {
             $filter = $filter->getChildComponent('-list');
             //TODO don't hardcode that here
         }
         $viewData = $filter->getChildComponent('-view');
         //TODO don't hardcode that here
     } else {
         $viewData = $this->_component;
     }
     $view = $viewData->getComponent();
     if ($view->hasSearchForm()) {
         $sf = $view->getSearchForm();
         $params = $this->getRequest()->getParams();
         $params[$sf->componentId . '-post'] = true;
         //post
         $params[$sf->componentId] = true;
         //submit
         $sf->getComponent()->processInput($params);
         //TODO don't do processInput here in _getSelect()
     }
     $ret = $view->getSelect();
     return $ret;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:28,代码来源:ViewController.php


示例2: load

 public function load($row, $postData = array())
 {
     $ret = parent::load($row, $postData);
     $component = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($row->component_id, array('ignoreVisible' => true, 'limit' => 1));
     if ($component) {
         //component can be non-existent if it's in a not selected card
         if (is_instance_of($component->componentClass, 'Kwc_Abstract_Image_Component')) {
             $contentWidth = null;
             $usesContentWidth = false;
             foreach (Kwc_Abstract::getSetting($component->componentClass, 'dimensions') as $dim) {
                 if (isset($dim['width'])) {
                     if ($dim['width'] == Kwc_Abstract_Image_Component::CONTENT_WIDTH) {
                         $usesContentWidth = true;
                     } else {
                         if ($dim['width'] > $contentWidth) {
                             $contentWidth = $dim['width'];
                         }
                     }
                 }
             }
             if ($usesContentWidth) {
                 $contentWidth = $component->getComponent()->getMaxContentWidth();
             }
         } else {
             $contentWidth = $component->getComponent()->getContentWidth();
         }
         $ret[$this->getFieldName()]['contentWidth'] = $contentWidth;
     }
     return $ret;
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:30,代码来源:ImageFile.php


示例3: testIt

 public function testIt()
 {
     $gen = Kwc_Abstract::getSetting('Kwf_Component_ChildSettings_SingleStatic_Root', 'generators');
     $c = $gen['empty']['component'];
     $this->assertTrue(is_instance_of($c, 'Kwc_Basic_None_Component'));
     $this->assertEquals(Kwc_Abstract::getSetting($c, 'componentName'), 'test123');
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:7,代码来源:Test.php


示例4: __construct

 public function __construct($reference = null, $fieldname = null)
 {
     if (is_object($reference)) {
         $model = $reference;
     } else {
         if (class_exists($reference) && is_instance_of($reference, 'Zend_Db_Table_Abstract')) {
             $model = new $reference();
         } else {
             $this->setReferenceName($reference);
         }
     }
     if (!$fieldname) {
         $fieldname = is_object($reference) ? get_class($reference) : $reference;
     }
     parent::__construct($fieldname);
     if (isset($model)) {
         if (!$model instanceof Kwf_Model_Interface) {
             $model = new Kwf_Model_Db(array('table' => $model));
         }
         $this->setModel($model);
     }
     $this->fields = new Kwf_Collection_FormFields();
     $this->setBorder(false);
     $this->setBaseCls('x2-plain');
     $this->setXtype('multifields');
     $this->setMinEntries(1);
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:27,代码来源:MultiFields.php


示例5: getAllMaintenanceJobs

 public static function getAllMaintenanceJobs()
 {
     static $ret;
     if (isset($ret)) {
         return $ret;
     }
     foreach (Kwc_Abstract::getComponentClasses() as $c) {
         if (is_instance_of($c, 'Kwf_Util_Maintenance_JobProviderInterface')) {
             $providerClasses[] = $c;
         }
     }
     foreach (Kwf_Model_Abstract::findAllInstances() as $model) {
         if ($model instanceof Kwf_Util_Maintenance_JobProviderInterface) {
             $providerClasses[] = get_class($model);
         }
     }
     $jobClasses = array();
     foreach ($providerClasses as $c) {
         $jobClasses = array_merge($jobClasses, call_user_func(array($c, 'getMaintenanceJobs')));
     }
     $jobClasses = array_unique($jobClasses);
     $ret = array();
     foreach ($jobClasses as $i) {
         $ret[] = new $i();
     }
     usort($ret, array('Kwf_Util_Maintenance_Dispatcher', '_compareJobsPriority'));
     return $ret;
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:28,代码来源:Dispatcher.php


示例6: _initFields

 protected function _initFields()
 {
     parent::_initFields();
     $showDirectoryClass = Kwc_Abstract::getSetting($this->getClass(), 'showDirectoryClass');
     $hideDirectoryClasses = Kwc_Abstract::getSetting($this->getClass(), 'hideDirectoryClasses');
     $cards = $this->add(new Kwf_Form_Container_Cards('source_component_id', trlKwf('Directory')));
     $defaultCard = null;
     $categories = Kwf_Component_Data_Root::getInstance()->getComponentsByClass('Kwc_Directories_Category_Directory_Component');
     foreach ($categories as $category) {
         $itemDirectory = $category->parent;
         if (is_instance_of($itemDirectory->componentClass, $showDirectoryClass)) {
             foreach ($hideDirectoryClasses as $c) {
                 if (is_instance_of($itemDirectory->componentClass, $c)) {
                     continue 2;
                 }
             }
             $categoriesModel = $category->getComponent()->getChildModel();
             $select = $categoriesModel->select()->whereEquals('component_id', $category->componentId);
             $values = array();
             foreach ($categoriesModel->getRows($select) as $row) {
                 $values[$row->id] = $row->name;
             }
             $card = $cards->add();
             $card->setTitle($category->parent->getTitle());
             $card->setName($category->componentId);
             if (!$defaultCard) {
                 $defaultCard = $category->componentId;
             }
             $model = Kwf_Model_Abstract::getInstance('Kwc_Directories_Category_ShowCategories_Model');
             $card->add(new Kwf_Form_Field_MultiCheckboxLegacy($model, trlKwf('Categories')))->setValues($values)->setReferences(array('columns' => array('component_id'), 'refColumns' => array('id')))->setColumnName('category_id');
         }
     }
     $cards->setDefaultValue($defaultCard);
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:34,代码来源:Form.php


示例7: _getParent

 private function _getParent()
 {
     $previous = null;
     $parent = $this->_data->parent;
     while ($parent && (!$parent->isPage || is_instance_of(Kwc_Abstract::getSetting($parent->componentClass, 'contentSender'), 'Kwf_Component_Abstract_ContentSender_Lightbox'))) {
         $previous = $parent;
         $parent = $parent->parent;
     }
     if ($parent instanceof Kwc_Basic_LinkTag_FirstChildPage_Data) {
         $parent = $parent->_getFirstChildPage();
         if ($parent == $this->_data) {
             $parent = $parent->parent;
             while ($parent && $parent instanceof Kwc_Basic_LinkTag_FirstChildPage_Data) {
                 $parent = $parent->parent;
             }
         }
     }
     if (!$parent) {
         $parent = $this->_data->getSubroot()->getChildPage(array('home' => true), array());
     }
     //TODO: the proper solution would be to restructure List_Switch so that the page is our parent
     if (is_instance_of($parent->componentClass, 'Kwc_List_Switch_Component') && $previous) {
         $parent = $parent->getChildComponent('_' . $previous->id);
     }
     return $parent;
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:26,代码来源:Lightbox.php


示例8: onListItemChange

 public function onListItemChange(Kwf_Component_Event_Component_Abstract $event)
 {
     // get previous and next items and delete the cache for them
     $c = $event->component;
     if ($c->componentClass != $this->_class) {
         foreach ($c->getRecursiveChildComponents(array('componentClass' => $this->_class)) as $c) {
             $i = $c->parent->parent;
             if (is_instance_of($i->componentClass, 'Kwc_Basic_LinkTag_Component')) {
                 $i = $i->parent;
             }
             $getChildren = array();
             while ($i != $event->component) {
                 if ($i->generator->getGeneratorFlag('table')) {
                     //only relevant if child is *not* created by a table generator
                     continue 2;
                 }
                 $getChildren[] = $i->generator->getIdSeparator() . $i->id;
                 $i = $i->parent;
             }
             $result = call_user_func(array($this->_class, 'getPreviousAndNextImagePage'), $this->_class, $event->component, $getChildren, true);
             foreach ($result as $r) {
                 if (!$r) {
                     continue;
                 }
                 $this->fireEvent(new Kwf_Component_Event_Component_ContentChanged($this->_class, $r));
             }
         }
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:29,代码来源:Events.php


示例9: alterBackendOrderForm

 public function alterBackendOrderForm(Kwc_Shop_AddToCartAbstract_FrontendForm $form)
 {
     $component = null;
     foreach (Kwc_Abstract::getComponentClasses() as $c) {
         if (is_instance_of($c, 'Kwc_Shop_Products_Directory_Component')) {
             $detailClasses = Kwc_Abstract::getChildComponentClasses($c, 'detail');
             foreach ($detailClasses as $key => $class) {
                 if (Kwc_Abstract::getChildComponentClass($class, 'addToCart') == $this->_class) {
                     $component = $key;
                 }
             }
         }
     }
     $m = Kwf_Model_Abstract::getInstance('Kwc_Shop_Products');
     $s = $m->select();
     $s->whereEquals('visible', 1);
     if ($component) {
         $s->whereEquals('component', $component);
     }
     $s->order('pos');
     $data = array();
     foreach ($m->getRows($s) as $product) {
         $data[] = array($product->current_price_id, $product->__toString() . ' (' . $product->current_price . ' €)');
     }
     $form->prepend(new Kwf_Form_Field_Select('shop_product_price_id', trlKwfStatic('Product')))->setValues($data)->setAllowBlank(false);
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:26,代码来源:OrderProductData.php


示例10: getDomainComponent

 /**
  * @param Kwf_Component_Data $component data, which is a parent domain component
  * @return Kwc_Root_DomainRoot_Domain_Component
  */
 public static function getDomainComponent(Kwf_Component_Data $component)
 {
     while ($component && !is_instance_of($component->componentClass, 'Kwc_Root_DomainRoot_Domain_Component')) {
         $component = $component->parent;
     }
     return $component;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:11,代码来源:Component.php


示例11: load

 public function load($row)
 {
     $name = $this->_dataIndex;
     if (is_string($this->_parentTable) || !is_array($this->_parentTable)) {
         $tables = array($this->_parentTable);
     } else {
         $tables = $this->_parentTable;
     }
     foreach ($tables as $t) {
         if ((is_object($t) || class_exists($t)) && is_instance_of($t, 'Zend_Db_Table_Abstract')) {
             $row = $row->findParentRow($t, $this->_ruleKey);
         } else {
             $row = $row->getParentRow($t);
         }
         if (!$row) {
             return '';
         }
     }
     if (!$this->_dataIndex) {
         return $row->__toString();
     }
     if (!isset($row->{$name}) && !is_null($row->{$name})) {
         //scheiß php
         throw new Kwf_Exception("Index '{$name}' doesn't exist in row.");
     }
     return $row->{$name};
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:27,代码来源:Parent.php


示例12: _initColumns

 protected function _initColumns()
 {
     parent::_initColumns();
     $this->_columns->add(new Kwf_Grid_Column('id'));
     //shows editDialog
     $this->_columns->add(new Kwf_Grid_Column_Button('properties', ' ', 20))->setButtonIcon('/assets/silkicons/newspaper.png')->setTooltip(trlKwf('Properties'));
     if (is_instance_of(Kwc_Abstract::getSetting($this->_getParam('class'), 'extConfig'), 'Kwc_Directories_Item_Directory_ExtConfigEditButtons')) {
         $extConfigType = 'extConfig';
     } else {
         if (is_instance_of(Kwc_Abstract::getSetting($this->_getParam('class'), 'extConfigControllerIndex'), 'Kwc_Directories_Item_Directory_ExtConfigEditButtons')) {
             $extConfigType = 'extConfigControllerIndex';
         }
     }
     $extConfig = Kwf_Component_Abstract_ExtConfig_Abstract::getInstance($this->_getParam('class'), $extConfigType)->getConfig(Kwf_Component_Abstract_ExtConfig_Abstract::TYPE_DEFAULT);
     $extConfig = $extConfig['items'];
     if (count($extConfig['countDetailClasses']) > 1 && !$this->_getModel()->hasColumn('component')) {
         throw new Kwf_Exception('If you have more than one detail-component your table has to have a column named "component"');
     }
     $i = 0;
     foreach ($extConfig['contentEditComponents'] as $ec) {
         $name = Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($ec['componentClass'], 'componentName'));
         $icon = Kwc_Abstract::getSetting($ec['componentClass'], 'componentIcon');
         $icon = new Kwf_Asset($icon);
         $this->_columns->add(new Kwc_Directories_Item_Directory_Trl_ControllerEditButton('edit_' . $i, ' ', 20))->setColumnType('editContent')->setEditComponentClass($ec['componentClass'])->setEditComponent($ec['component'])->setEditType($ec['type'])->setEditIdTemplate($ec['idTemplate'])->setEditComponentIdSuffix($ec['componentIdSuffix'])->setButtonIcon($icon->toString(array('arrow')))->setTooltip(trlKwf('Edit {0}', $name));
         $i++;
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:27,代码来源:Controller.php


示例13: _graphData

 private function _graphData($class, $parent = '')
 {
     if (is_instance_of($class, 'Kwc_Paragraphs_Component')) {
         return;
     }
     static $processed = array();
     $ret = '';
     $last = $class . $parent;
     foreach (Kwc_Abstract::getSetting($class, 'generators') as $generatorKey => $generator) {
         $g = $this->_getGenerator($class, $generatorKey);
         $shape = $this->_getShape($g);
         foreach ($this->_getChildren($generator) as $child) {
             $color = $this->_getColor($child);
             $fontcolor = in_array($child, $processed) ? 'grey40' : 'black';
             $classname = $this->_getClassName($child, $class);
             $label = '';
             if ($g->getGeneratorFlag('table')) {
                 $label = 'headlabel = "*"';
             }
             $name = $child . $class;
             $node = "Node_{$name}";
             $ret .= "{ {$name} [label=\"{$classname}\" shape={$shape} color={$color} fontcolor=\"{$fontcolor}\" fontsize=12] } \n";
             $ret .= "{ {$node} [shape=point] }\n";
             $ret .= "{ {$node} -> {$name} [arrowhead=none {$label}] }\n";
             $ret .= "{ {$last} -> {$node} [arrowhead=none] rank=same }\n";
             $ret .= "\n";
             $last = $node;
             if (!in_array($child, $processed)) {
                 $processed[] = $child;
                 $ret .= $this->_graphData($child, $class);
             }
         }
     }
     return $ret;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:35,代码来源:ClassTreeController.php


示例14: onRecursiveUrlChanged

 public function onRecursiveUrlChanged(Kwf_Component_Event_Page_RecursiveUrlChanged $event)
 {
     $component = $event->component->parent;
     while ($component && is_instance_of($component->componentClass, 'Kwc_Basic_LinkTag_FirstChildPage_Component')) {
         $this->_fireUrlChanged($component);
         $component = $component->parent;
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:8,代码来源:Events.php


示例15: getLinkTitle

 public function getLinkTitle()
 {
     $parent = $this->parent;
     if (is_instance_of($parent->componentClass, 'Kwc_Basic_LinkTag_Component')) {
         return $this->parent->getComponent()->getLinkTitle();
     }
     return parent::getLinkTitle();
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:8,代码来源:Data.php


示例16: _getImageEnlargeComponent

 private function _getImageEnlargeComponent()
 {
     $d = $this->getData();
     while (!is_instance_of($d->componentClass, 'Kwc_Basic_ImageEnlarge_Trl_Component')) {
         $d = $d->parent;
     }
     return $d->getComponent();
 }
开发者ID:nsams,项目名称:koala-framework,代码行数:8,代码来源:Component.php


示例17: _getForm

 private function _getForm()
 {
     $ret = $this->getData();
     while ($ret && !is_instance_of($ret->componentClass, 'Kwc_Form_Dynamic_Component')) {
         $ret = $ret->parent;
     }
     $ret = $ret->getChildComponent('-form');
     return $ret;
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:9,代码来源:Component.php


示例18: load

 public function load($row, array $info = array())
 {
     $c = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($row->component_id, array('ignoreVisible' => true));
     if ($c && is_instance_of($c->componentClass, 'Kwc_Abstract_Cards_Trl_Component')) {
         return $c->chained->getComponent()->getRow()->component;
     } else {
         return '';
     }
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:9,代码来源:Form.php


示例19: getTemplateVars

 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $c = $this->getData()->parent->chained->componentClass;
     if (!is_instance_of($c, 'Kwc_Shop_Cart_Checkout_Payment_None_Component')) {
         $ret['paymentTypeText'] = $this->getData()->trlStaticExecute(Kwc_Abstract::getSetting($c, 'componentName'));
     }
     return $ret;
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:9,代码来源:Component.php


示例20: getGeneratorFlags

 public function getGeneratorFlags()
 {
     $ret = parent::getGeneratorFlags();
     if (is_instance_of($this->_class, 'Kwc_Root_TrlRoot_Chained_Component')) {
         $ret['trlBase'] = true;
     }
     $ret['chainedType'] = 'Trl';
     return $ret;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:9,代码来源:Generator.php



注:本文中的is_instance_of函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_int函数代码示例发布时间:2022-05-15
下一篇:
PHP is_installed函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap